Object Oriented Programming interview questions part 11
Object Oriented Programming interview questions part 11
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Copy constructor is a constructor which ________________
Correct Answer is : Creates an object by initializing it with another previously created object of same class
2. The copy constructor can be used to:
Correct Answer is : Initialize one object from another object of same type
3. If two classes have exactly same data members and member function and only they differ by class name. Can copy constructor be used to initialize one class object with another class object?
Correct Answer is : No, not possible
4. The copy constructors can be used to ________
Correct Answer is : Copy an object so that it can be passed to a function
5. Which returning an object, we can use ____________
Correct Answer is : Copy constructor
6. If programmer doesn’t define any copy constructor then _____________
Correct Answer is : Compiler provides an implicit copy constructor
7. If a class implements some dynamic memory allocations and pointers then _____________
Correct Answer is : Copy constructor must be defined