61. | Identify the operator that is NOT used with pointers |
a. | -> |
b. | & |
c. | * |
d. | >> |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (d).>>
|
62. | Consider the following statements
char *ptr; ptr = “hello”; cout << *ptr; What will be printed? |
a. | first letter |
b. | entire string |
c. | it is a syntax error |
d. | last letter |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (a).first letter
|
63. | In which case is it mandatory to provide a destructor in a class? |
a. | Almost in every class |
b. | Class for which two or more than two objects will be created |
c. | Class for which copy constructor is defined |
d. | Class whose objects will be created dynamically |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (d).Class whose objects will be created dynamically
|
64. | The members of a class, by default, are |
a. | public |
b. | protected |
c. | private |
d. | mandatory to specify |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).private
|
65. | 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) { } |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (b).Book ( Book b) { }
|
66. | 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 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).Public members of the base class become protected members of the derived class
|
67. | 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 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (d).none of the above
|
68. | Exception handling is targeted at |
a. | Run-time error |
b. | Compile time error |
c. | Logical error |
d. | All of the above |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (a).Run-time error
|
69. | 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 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c). base class object as well as derived class object
|
70. | 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 |
View Answer Report Discuss Too Difficult! Search Google |
Answer: (c).only parameters of the basic type
|