Thursday, September 25, 2014

Objects and Classes - C++

1. 
Which of the following statements is correct when a class is inherited publicly?
A.Public members of the base class become protected members of derived class.
B.Public members of the base class become private members of derived class.
C.Private members of the base class become protected members of derived class.
D.Public members of the base class become public members of derived class.
2. 
Which of the following statements is correct about the constructors and destructors?
A.Destructors can take arguments but constructors cannot.
B.Constructors can take arguments but destructors cannot.
C.Destructors can be overloaded but constructors cannot be overloaded.
D.Constructors and destructors can both return a value.
3. 
Which of the following access specifies is used in a class definition by default?
A.ProtectedB.Public
C.PrivateD.Friend
4. 
Which of the following statement is correct with respect to the use of friend keyword inside a class?
A.A private data member can be declared as a friend.
B.A class may be declared as a friend.
C.An object may be declared as a friend.
D.We can use friend keyword as a class name.
5. 
Which of the following keywords is used to control access to a class member?
A.DefaultB.Break
C.ProtectedD.Asm

No comments: