Classes and Objects – MCQs

30 Score: 0 Attempted: 0/30 Subscribe
1. : What is a class in C++?
 
2. : What is an object in C++?
 
3. : What keyword is used to define a class?
 
4. : What is the default access specifier for class members?
 
5. : How are class members accessed from an object?
 
6. : What is a constructor in C++?
 
7. : Which of the following is true about constructors?
 
8. : What is the function of a destructor in a class?
 
9. : Which symbol is used to define scope resolution in C++?
 
10. : What is the keyword used to create an object dynamically?
 
11. : What is encapsulation?
 
12. : Which member function is invoked when an object is destroyed?
 
13. : Which of the following correctly declares an object of class Student?
 
14. : Which keyword is used to make data members accessible outside the class?
 
15. : What is data hiding in OOP?
 
16. : Can a class have multiple constructors?
 
17. : What happens if no constructor is defined in a class?
 
18. : Which constructor is invoked when an object is copied?
 
19. : What type of function is declared using the friend keyword?
 
20. : Can we overload constructors in a class?
 
21. : Which function type does not belong to any object of the class?
 
22. : How many objects can be created from one class?
 
23. : What is the output of this statement? cout << “C++”;
 
24. : Which of the following is the correct syntax to call a class function?
 
25. : Which keyword is used to stop data modification from a function?
 
26. : What is the use of the this pointer?
 
27. : Can we define functions inside a class in C++?
 
28. : Which class member is shared among all objects of a class?
 
29. : What is the special function used to clean up when an object is destroyed?
 
30. : Can a class have both data and functions?
 

Leave a Comment

All copyrights Reserved by MCQsAnswers.com - Powered By T4Tutorials