Q) Compile time polymorphism in C++ language are
- Operator overloading
- Function overloading
- Function overriding
- B Only
- A & B
Q) C++ abstract class can contain
- Pure virtual function
- Non-virtual function
- Only pure virtual function
- Both pure virtual and non-virtual function
Q) False statements about function overloading is
- Defining multiple functions with same name in a class is called function overloading
- Overloaded function must differ in their order and types of arguments.
- Overloaded functions should be preceded with virtual keyword
- No statement is false
Q) Following keyword is used before a function in a base class to be overridden in derived class in C++
Q) Which of the following cannot be overloaded in C++?
- Increment operator
- New and delete operator
Destructor of a class cannot be overloaded in C++ programming. Increment operator, constructor and new and delete can be overloaded.
You can read here in C++ constructor overloading example, and benefits of constructor overloading in C++ programs post. Also, the program example of new and delete operator overloading