Q.46   Given a class named Book, which of the following is not a valid constructor?  
(A)  Book ( ) { }               (B)  Book ( Book b) { }
(C)  Book ( Book &b) { }   (D)  Book (char* author, char* title) { }
   
  Ans:B
 
Q47  Which of the statements is true in a protected derivation of a derived class from a base class?

(A)  Private members of the base class become protected members of the derived class  
(B) Protected members of the base class become public members of the derived class
(C) Public members of the base class become protected members of the derived class  
(D) Protected derivation does not affect private and protected members of the derived class.
 
  Ans:C
 
Q48  Which of the following statements is NOT valid about operator overloading?  

(A)  Only existing operators can be overloaded.   
(B)  Overloaded operator must have at least one operand of its class type.
(C)  The overloaded operators follow the syntax rules of the original operator.
(D)  none of the above.  
 
   Ans:D
 
Q.49  Exception handling is targeted at  

(A) Run-time error  (B) Compile time error
(C) Logical error  (D) All of the above.
   
  Ans:A
 
Q.50   A pointer to the base class can hold address of
 
(A) only base class object   
(B) only derived class object
(C) base class object as well as derived class object  
(D) None of the above


 Ans:C
 
Q.51   Function templates can accept

(A)  any type of parameters   
(B)  only one parameter
(C)  only parameters of the basic type
(D)  only parameters of the derived type
 
  Ans:C
 
Q.52   How many constructors can a class have?

(A)  0  (B)  1
(C)  2  (D)  any number  
 
  Ans:D
 
Q.53   The new operator 
          
(A)   returns a pointer to the variable  
(B)   creates a variable called new
(C)  obtains memory for a new variable   
(D)  tells how much memory is available
   
  Ans:C
 
Q.54  Consider the following statements:

   int x = 22,y=15;
   x = (x>y) ? (x+y) : (x-y);  
   What will be the value of x after executing these statements?

(A)   22  (B)  37
(C)   7   (D)  Error. Cannot be executed
   
  Ans:B
 
Q.55  An exception is caused by

(A)  a hardware problem  (B) a problem in the operating system
(C)  a syntax error      (D)  a run-time error
 
  Ans:D  
 
Q.56  A template class

(A)  is designed to be stored in different containers           
(B) works with different data types
(C)  generates objects which must be identical          
(D)  generates classes with different numbers of member functions.
 
   Ans:B


Q.57  Which of the following is the valid class declaration header for the derived class d with base
classes b1 and b2?
(A)  class d : public b1, public b2 (B)  class d : class b1, class b2
(C)  class d : public b1, b2  (D)  class d : b1, b2
 
   Ans:A
 
Q.58  A library function exit() causes an exit from  

(A)  the loop in which it occurs  (B)  the block in which it occurs
(C)  the function in which it occurs  (D)  the program in which it occurs  
 
  Ans:D
 
Q.59  RunTime polymorphism is achieved by ___________

(A) friend function  (B) virtual function
(C) operator overloading  (D) function overloading
 
  Ans:B
 
Q.60 Declaration of a pointer reserves memory space
 
(A)  for the object.
(B)  for the pointer.
(C)  both for the object and the pointer.
(D)  none of these.
 

   Ans:B