: C++ Classes And Objects
Following questions depends on the c++ classes and objects. Each questions has its unique answer.
1. Which of the following is false?
Answer: C. Variables having visibility may not have scope
2. For a method to be an interface between the outside world and a class,it has to be declared ?
3. In C++, a function contained within the class is called ?
Answer: A. member function
4. classes are useful because they
Answer: B. permit data to be hidden from other classes
5. The public files in a class library usually contain ?
Answer: C. class declarations
Answer: C. Inline
A Class cannot be a Inline.
7. Objects of the same class share the values of ...... while they maintain separate values for ........ .
Answer: A. Static variables, non static variables
Objects of the same class share the values of Static variables while they maintain separate values for non static variables.
8. Which of the following keywords cannot appear inside a class definition ?
Answer: C. template
A Template keyword cannot appear inside a class function.
Answer: A. Member wise copying of objects
10. Which member function of class cannot modify its objects attributes ?
Answer: C. Constant member functions