Home > Object Oriented Programming > Quizzes > Object Oriented Programming Practice Test: Class Members & Types
Object Oriented Programming Practice Test: Class Members & Types
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 69% Most missed: “Which language can use inheritance with local classes?”
Quiz on data members, member functions, local and nested class.   In object-oriented programming (OOP), there are two types of class members: instance members and static members. Instance members are associated with a specific instance of a class, while static members are associated with the class itself. Instance members: include variables (or fields) and methods. Variables store data specific to the instance, while methods define the behavior of the instance. Static members: are shared by all instances of a class. They include static variables and static methods. Static variables are... Show more
Object Oriented Programming Practice Test: Class Members & Types
Time left 00:00
25 Questions

1. For overloading “( )”, “[ ]” or “->” operators, a class __________
2. Which type of data can a local class access from the function in which it is defined?
3. How many local classes can be defined inside a single function?
4. Static member functions _____________
5. Use of nested class ____________ encapsulation.
6. How many data members can a class contain?
7. Non-static nested classes have access to _____________ from enclosing class.
8. How can a static member function be called in the main function?
9. All member functions of a local class must be ___________
10. All the member functions of local classes are __________ by default.
11. Which among the following is the correct advantage/disadvantage of nested classes?
12. Local classes can access the type names and enumerators defined by the enclosing function.
13. What are inline member functions?
14. Data members ________________ (C++)
15. Instance of inner class can exist only _______________ enclosing class.
16. A member function can _______________ of the same class.
17. Static nested classes doesn’t have access to _________________ from enclosing class.
18. What happens if non static members are used in static member function?
19. Which among the following is true for data members?
20. The nested class can be declared ___________________
21. A class can have self-referential data members.
22. Which among the following best describes a nested class?
23. The static member functions can only use ________
24. Which language can use inheritance with local classes?
25. A static nested class is _____________ class in behavior that is nested in another _________ class.