An instance of a class is called __________.
- Astructure
- Bdata type
- Cobject
- Dmember function
An object is a variable (instance) created from a class.
MCQs, short and long questions from lecture 26.Lecture 26 ki MCQs, short aur long sawal.
1 MCQ · 1 short question · 1 MCQ from past papers1 MCQ · 1 short sawal · 1 MCQ past papers se
An instance of a class is called __________.
An object is a variable (instance) created from a class.
No MCQs match this filter.Is filter mein koi MCQ nahi.
Following code segment contains errors. Give brief description of each error. Class circle: { Private: double centerX, double center, double radius, Public: setCenter(double.double); setRadius(double); }
Errors: 1. Class must be lowercase class (C++ is case-sensitive). 2. No colon after the class name (circle:) unless inheriting. 3. Private: and Public: must be lowercase private: and public:. 4. Data member declarations must end with semicolons, not commas (double centerX; ...); center should presumably be centerY. 5. Member functions need a return type, e.g. void setCenter(...); void setRadius(double); 6. Parameter types must be separated by a comma: setCenter(double, double), not double.double. 7. The class definition must end with }; (semicolon missing). Corrected: class circle { private: double centerX; double centerY; double radius; public: void setCenter(double, double); void setRadius(double); };
No long questions added yet.Abhi koi long sawal shamil nahi.