Question-11. What is abstract class in C++ ?

Answer- A class with at least one pure virtual function is called as abstract class. We cannot instantiate an abstract class.

 

Question-12. What is reference variable in C++ ?

Answer- A reference variable is an alias name for the existing variable. Which mean both the variable name and reference variable point to the same memory location. Therefore updation on the original variable can be achieved using reference variable too.

 

Question-13. What is the role of static keyword on a class member variable ?

Answer- A static variable does exist though the objects for the respective class are not created. Static member variable share a common memory across all the objects created for the respective class. A static member variable can be referred using the class name itself.

 

Question-14. Explain the static member function ?

Answer- A static member function can be invoked using the class name as it exists before class objects comes into existence. It can access only static members of the class.

 

Question-15. What is function overloading ?

Answer- Defining several functions with the same name with unique list of parameters is called as function overloading.

 

Question-16. What is operator overloading ?

Answer- Defining a new job for the existing operator w.r.t the class objects is called as operator overloading.

 

Question-17. What is default standard streams in C++ ?

Answer- cin, cout, cerr and clog.

 

Question-18. Which access specifier/s can help to achieve data hiding in C++ ?

Answer- Private and Protected

 

Question-19. When a class member is defined outside the class, which operator can be used to associate the function definition to a particular class ?

Answer- Scope resolution operator (::)

 

Question-20. What is destructor? Can it be overloaded ?

Answer- A destructor is the member function of the class which is having the same name as the class name and prefixed with tilde (~) symbol. It gets executed automatically w.r.t the object as soon as the object loses its scope. It cannot be overloaded and the only form is without the parameters.