C++ MCQs - Classes & Objects
This section focuses on the "Classes And Objects" in C++ programming langauge. These Multiple Choice Questions (MCQ) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1.Which of the following is not correct for virtual function in C++ ?.
Explanation:: Virtual function is can’t be static in C++.
2.How can we make a class abstract?
3.How many specifiers are present in access specifiers in class?
Explanation:There are three types of access specifiers. They are public, protected and private.
4.Which of these following members are not accessed by using direct member access operator?
Explanation:Because of the access is given to the private and protected, We can’t access them by using direct member access operator.
5.Which other keywords are also used to declare the class other than class?
Explanation:Struct and union take the same definition of class but differs in the access techniques.
6. Which of the following is true?
Explanation:very object maintains a copy of non-static data members. For example, let Student be a class with data members as name, year, batch. Every object of student will have its own name, year and batch. On a side note, static data members are shared among objects. All objects share codes of all methods
7.Which of the following can be overloaded?
8.Which is also called as abstract class?
Explanation:Classes that contain at least one pure virtual function are called as abstract base classes.
Also check :