Sail E0 Webinar

MCQs

Total Questions : 23 | Page 2 of 3 pages
Question 11.

Which of the following also known as an instance of a class?


  1.    Friend Functions
  2.    Object
  3.    Member Functions
  4.    Member Variables
 Discuss Question
Answer: Option B. -> Object


Question 12.

Which of the following statement is correct with respect to the use of friend keyword inside a class?


  1.    A private data member can be declared as a friend.
  2.    A class may be declared as a friend.
  3.    An object may be declared as a friend.
  4.    We can use friend keyword as a class name.
 Discuss Question
Answer: Option B. -> A class may be declared as a friend.


Question 13.

Which of the following keywords is used to control access to a class member?


  1.    Default
  2.    Break
  3.    Protected
  4.    Asm
 Discuss Question
Answer: Option C. -> Protected


Question 14.

Which of the following can access private data members or member functions of a class?


  1.    Any function in the program.
  2.    All global functions in the program.
  3.    Any member function of that class.
  4.    Only public member functions of that class.
 Discuss Question
Answer: Option C. -> Any member function of that class.


Question 15.

Which of the following type of data member can be shared by all instances of its class?


  1.    Public
  2.    Inherited
  3.    Static
  4.    Friend
 Discuss Question
Answer: Option C. -> Static


Question 16.

Which of the following access specifies is used in a class definition by default?


  1.    Protected
  2.    Public
  3.    Private
  4.    Friend
 Discuss Question
Answer: Option C. -> Private


Question 17.

Which of the following statements is correct about the constructors and destructors?


  1.    Destructors can take arguments but constructors cannot.
  2.    Constructors can take arguments but destructors cannot.
  3.    Destructors can be overloaded but constructors cannot be overloaded.
  4.    Constructors and destructors can both return a value.
 Discuss Question
Answer: Option B. -> Constructors can take arguments but destructors cannot.


Question 18.

Which of the following two entities (reading from Left to Right) can be connected by the dot operator?


  1.    A class member and a class object.
  2.    A class object and a class.
  3.    A class and a member of that class.
  4.    A class object and a member of that class.
 Discuss Question
Answer: Option D. -> A class object and a member of that class.


Question 19.

Which of the following statements is correct when a class is inherited publicly?


  1.    Public members of the base class become protected members of derived class.
  2.    Public members of the base class become private members of derived class.
  3.    Private members of the base class become protected members of derived class.
  4.    Public members of the base class become public members of derived class.
 Discuss Question
Answer: Option D. -> Public members of the base class become public members of derived class.


Question 20.

How can we make a class abstract?


  1.    By making all member functions constant.
  2.    By making at least one member function as pure virtual function.
  3.    By declaring it abstract using the static keyword.
  4.    By declaring it abstract using the virtual keyword.
 Discuss Question
Answer: Option B. -> By making at least one member function as pure virtual function.


Latest Videos

Latest Test Papers