Which operator is overloaded for a cout object?
cout in C++ uses << operator to print anything so << operator is overloaded for a cout object.
Which of the following cannot be used with the virtual keyword?
b) Member functions
Virtual keyword cannot be used with constructors as constructors are defined to initialized an object of particular class hence no other class needs constructor of other class.
Which concept is used to implement late binding?
a) Virtual functions
b) Operator functions
c) Constant functions
d) Static functions
Virtual functions are used to implement the concept of late binding i.e. binding actual functions to their calls.
Which of the following is correct?
a) C++ allows static type checking
b) C++ allows dynamic type checking.
c) C++ allows static member function to be of type const.
d) C++ allows both static and dynamic type checking
C++ allows both static and dynamic type checking i.e. types are checked by the compiler.
Which of the following supports the concept that reusability is a desirable feature of a language?
a) It reduces the testing time
b) It reduces maintenance cost
c) It decreases the compilation time
d) It reduced both testing and maintenance time
As we will be using the existing code therefore we don’t need to check the code again and again so testing and maintenance time decreases but the compiler time may increase or remains same because though we are reusing the code but every part needs to be compiled and extra include statement needs to be executed therefore compilation time may remain same or increases.