Q) Class allows only one object of it to be created though out the program life cycle
- Singleton class
- Abstract class
- Friend class
- All classes
Answer: 1
Q) Statically allocated object for class A in C++ is
- A *obj = new A();
- A obj;
- A obj = new A();
- None
Answer: 2
Q) When you create an object of a class A like A obj ; then which one will be called automatically
- Constructor
- Destructor
- Copy constructor
- Assignment operator
Answer: 1
Q) When you create an object of a derived class in C++
- Derived class constructor is called first then the base class constructor
- Base class constructor is called first then derived class constructor
- base class constructor will not be called
- none of the above
Answer: 2
Q) The class in C++ which act only as a base class and object of it cannot be created is
- parent class
- super class
- abstract class
- none of the above
Answer: 3