Sail E0 Webinar

MCQs

Total Questions : 57 | Page 2 of 6 pages
Question 11.

What will happen if a class is not having any name?


  1.    It cannot have a destructor.
  2.    It cannot have a constructor.
  3.    It is not allowed.
  4.    Both A and B.
 Discuss Question
Answer: Option D. -> Both A and B.


Question 12.

Which of the following statements regarding inline functions is correct?


  1.    It speeds up execution.
  2.    It slows down execution.
  3.    It increases the code size.
  4.    Both A and C.
 Discuss Question
Answer: Option D. -> Both A and C.


Question 13.

Which of the following keyword is used to overload an operator?


  1.    overload
  2.    operator
  3.    friend
  4.    override
 Discuss Question
Answer: Option B. -> operator


Question 14.

Which one of the following is the correct way to declare a pure virtual function?


  1.    virtual void Display(void){0};
  2.    virtual void Display = 0;
  3.    virtual void Display(void) = 0;
  4.    void Display(void) = 0;
 Discuss Question
Answer: Option C. -> virtual void Display(void) = 0;


Question 15.

Which of the following header file includes definition of cin and cout?


  1.    istream.h
  2.    ostream.h
  3.    iomanip.h
  4.    iostream.h
 Discuss Question
Answer: Option D. -> iostream.h


Question 16.

In which of the following a virtual call is resolved at the time of compilation?


  1.    From inside the destructor.
  2.    From inside the constructor.
  3.    From inside the main().
  4.    Both A and B.
 Discuss Question
Answer: Option D. -> Both A and B.


Question 17.

Which of the following is not a type of inheritance?


  1.    Multiple
  2.    Multilevel
  3.    Distributive
  4.    Hierarchical
 Discuss Question
Answer: Option C. -> Distributive


Question 18.

Which of the following operators cannot be overloaded?


  1.    []
  2.    ->
  3.    ?:
  4.    *
 Discuss Question
Answer: Option C. -> ?:


Question 19.

What happens if the base and derived class contains definition of a function with same prototype?


  1.    Compiler reports an error on compilation.
  2.    Only base class function will get called irrespective of object.
  3.    Only derived class function will get called irrespective of object.
  4.    Base class object will call base class function and derived class object will call derived class function.
 Discuss Question
Answer: Option D. -> Base class object will call base class function and derived class object will call derived class function.


Question 20.

Which of the following are available only in the class hierarchy CHAIN ?


  1.    Public data members
  2.    Private data members
  3.    Protected data members
  4.    Member functions
 Discuss Question
Answer: Option C. -> Protected data members


Latest Videos

Latest Test Papers