Sail E0 Webinar

MCQs

Total Questions : 57 | Page 3 of 6 pages
Question 21.

Which of the following is correct about the statements given below?

      1. All operators can be overloaded in C++.

      2. All operators can be overloaded in C++.


  1.    Only I is true.
  2.    Both I and II are false.
  3.    Only II is true.
  4.    Both I and II are true.
 Discuss Question
Answer: Option B. -> Both I and II are false.


Question 22.

Which of the following factors supports the statement that reusability is a desirable feature of a language?


  1.    It decreases the testing time.
  2.    It lowers the maintenance cost.
  3.    It reduces the compilation time.
  4.    Both A and B.
 Discuss Question
Answer: Option D. -> Both A and B.


Question 23.

Which of the following is a mechanism of static polymorphism?


  1.    Operator overloading
  2.    Function overloading
  3.    Templates
  4.    All of the above
 Discuss Question
Answer: Option D. -> All of the above


Question 24.

Which of the following ways are legal to access a class data member using this pointer?


  1.    this->x
  2.    this.x
  3.    *this.x
  4.    *this-x
 Discuss Question
Answer: Option A. -> this->x


Question 25.

Which of the following statement is correct?


  1.    C++ allows static type checking.
  2.    C++ allows dynamic type checking.
  3.    C++ allows static member function be of type const.
  4.    Both A and B.
 Discuss Question
Answer: Option D. -> Both A and B.


Question 26.

Which one of the following options is correct about the statement given below? The compiler checks 

the type of reference in the object and not the type of object.


  1.    Inheritance
  2.    Polymorphism
  3.    Abstraction
  4.    Encapsulation
 Discuss Question
Answer: Option B. -> Polymorphism


Question 27.

Which of the following is the correct way of declaring a function as constant?


  1.    const int ShowData(void) { /* statements */ }
  2.    int const ShowData(void) { /* statements */ }
  3.    int ShowData(void) const { /* statements */ }
  4.    Both A and B
 Discuss Question
Answer: Option C. -> int ShowData(void) const { /* statements */ }


Question 28.

Which of the following concepts is used to implement late binding?


  1.    Virtual function
  2.    Operator function
  3.    Const function
  4.    Static function
 Discuss Question
Answer: Option A. -> Virtual function


Question 29.

Which of the following functions are performed by a constructor?


  1.    Construct a new class
  2.    Construct a new object
  3.    Construct a new function
  4.    Initialize objects
 Discuss Question
Answer: Option D. -> Initialize objects


Question 30.

Which of the following problem causes an exception?


  1.    Missing semicolon in statement in main().
  2.    A problem in calling function.
  3.    A syntax error.
  4.    A run-time error.
 Discuss Question
Answer: Option D. -> A run-time error.


Latest Videos

Latest Test Papers