Q.1
Copy constructor is a constructor which ________________
  • a) Creates an object by copying values from any other object of same class
  • b) Creates an object by copying values from first object created for that class
  • c) Creates an object by copying values from another object of another class
  • d) Creates an object by initializing it with another previously created object of same class
Q.2
The copy constructor can be used to ____________
  • a) Initialize one object from another object of same type
  • b) Initialize one object from another object of different type
  • c) Initialize more than one object from another object of same type at a time
  • d) Initialize all the objects of a class to another object of another class
Q.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?
  • a) Yes, possible
  • b) Yes, because the members are same
  • c) No, not possible
  • d) No, but possible if constructor is also same
Q.4
The copy constructors can be used to ________
  • a) Copy an object so that it can be passed to a class
  • b) Copy an object so that it can be passed to a function
  • c) Copy an object so that it can be passed to another primitive type variable
  • d) Copy an object for type casting
Q.5
Which returning an object, we can use ____________
  • a) Default constructor
  • b) Zero argument constructor
  • c) Parameterized constructor
  • d) Copy constructor
Q.6
If programmer doesn’t define any copy constructor then _____________
  • a) Compiler provides an implicit copy constructor
  • b) Compiler gives an error
  • c) The objects can’t be assigned with another objects
  • d) The program gives run time error if copying is used
Q.7
If a class implements some dynamic memory allocations and pointers then _____________
  • a) Copy constructor must be defined
  • b) Copy constructor must not be defined
  • c) Copy constructor can’t be defined
  • d) Copy constructor will not be used
Q.8
What is the syntax of copy constructor?
  • a) classname (classname &obj){ /*constructor definition*/ }
  • b) classname (cont classname obj){ /*constructor definition*/ }
  • c) classname (cont classname &obj){ /*constructor definition*/ }
  • d) classname (cont &obj){ /*constructor definition*/ }
Q.9
Object being passed to a copy constructor ___________
  • a) Must be passed by reference
  • b) Must be passed by value
  • c) Must be passed with integer type
  • d) Must not be mentioned in parameter list
Q.10
Out of memory error is given when the object _____________ to the copy constructor.
  • a) Is passed with & symbol
  • b) Is passed by reference
  • c) Is passed as <classname &obj>
  • d) Is not passed by reference
Q.11
Copy constructor will be called whenever the compiler __________
  • a) Generates implicit code
  • b) Generates member function calls
  • c) Generates temporary object
  • d) Generates object operations
Q.12
The deep copy is possible only with the help of __________
  • a) Implicit copy constructor
  • b) User defined copy constructor
  • c) Parameterized constructor
  • d) Default constructor
Q.13
Can a copy constructor be made private?
  • a) Yes, always
  • b) Yes, if no other constructor is defined
  • c) No, never
  • d) No, private members can’t be accessed
Q.14
The arguments to a copy constructor _____________
  • a) Must be const
  • b) Must not be cosnt
  • c) Must be integer type
  • d) Must be static
Q.15
Copy constructors are overloaded constructors.
  • a) True
  • b) False
0 h : 0 m : 1 s