Friday, September 26, 2014

Objects and Classes - C++

1. 
Which of the following can access private data members or member functions of a class?
A.Any function in the program.
B.All global functions in the program.
C.Any member function of that class.
D.Only public member functions of that class.
2. 
Which of the following type of data member can be shared by all instances of its class?
A.PublicB.Inherited
C.StaticD.Friend
3. 
Which of the following also known as an instance of a class?
A.Friend Functions
B.Object
C.Member Functions
D.Member Variables
4. 
Constructor is executed when _____.
A.an object is created
B.an object is used
C.a class is declared
D.an object goes out of scope.
5. 
Which of the following statements about virtual base classes is correct?
A.It is used to provide multiple inheritance.
B.It is used to avoid multiple copies of base class in derived class.
C.It is used to allow multiple copies of base class in a derived class.
D.It allows private members of the base class to be inherited in the derived class.

No comments: