Question: 11 -
Which of the following statements is correct when a class is inherited publicly?
-
Public members of the base class become private members of derived class.
-
Public members of the base class become public members of derived class.
-
Public members of the base class become protected members of derived class.
-
Private members of the base class become protected members of derived class.
Answer:
Public members of the base class become public members of derived class.
Solution not available.
Question: 12 -
Which of the following access specifies is used in a class definition by default?
-
Private
-
Protected
-
Friend
-
Public
Answer:
Private
Solution not available.
Question: 13 -
Which of the following two entities (reading from Left to Right) can be connected by the dot operator?
-
A class object and a member of that class.
-
A class object and a class.
-
A class member and a class object.
-
A class and a member of that class.
Answer:
A class object and a member of that class.
Solution not available.
Question: 14 -
Which of the following statements is correct about the constructors and destructors?
-
Constructors and destructors can both return a value.
-
Destructors can take arguments but constructors cannot.
-
Destructors can be overloaded but constructors cannot be overloaded.
-
Constructors can take arguments but destructors cannot.
Answer:
Constructors can take arguments but destructors cannot.
Solution not available.
Question: 15 -
Which of the following statements is incorrect?
-
Friend keyword can be used for a function in the public section of a class.
-
Friend keyword can be used for a function in the private section of a class.
-
Friend keyword can be used on main().
-
Friend keyword can be used in the class to allow access to another class.
Answer:
Friend keyword can be used on main().