A class's __________ is called when an object is destroyed.
1.constructor
2.destructor
3.assignment function
4.copy constructor
It is a __________ error to pass arguments to a destructor.
1.logical
2.virtual
3.syntax
4.linker
Which of the following gets called when an object is being created?
1.constructor
2. virtual function
3.destructor
4.main
Which of the following statements are correct?
1.Constructor is always called explicitly.
2.Constructor is called either implicitly or explicitly, whereas destructor is always called implicitly.
3.Destructor is always called explicitly.
4. Constructor and destructor functions are not called at all as they are always inline.
A union that has no constructor can be initialized with another union of __________ type.
1.different
2.same
3.virtual
4.class
A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values
1.default constructor
2.copy constructor
3. Both A and B
4.None of these
How many default constructors per class are possible?
1.Only one
2.Two
3.Three
4.Unlimited
If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?
1.Preprocessor
2.Compiler
3.Linker
4. main() function
To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .
1. destructor
2.delete
3. delete[]
4.kill[]
A destructor takes __________ arguments.
1.one
2.two
3.three
4.no
A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.
1.constructor
2.destructor
3.function
4.object
Constructors __________ to allow different approaches of object construction.
1. cannot overloaded
2.can be overloaded
3. can be called
4. can be nested
Copy constructor must receive its arguments by __________ .
1.either pass-by-value or pass-by-reference
2.only pass-by-value
3.only pass-by-reference
4.only pass by address
Destructor calls are made in which order of the corresponding constructor calls?
1.Reverse order
2.Forward order
3.Depends on how the object is constructed
4. Depends on how many objects are constructed
Destructor has the same name as the constructor and it is preceded by ______ .
1.!
2.?
3.~
4.$
Destructors __________ for automatic objects if the program terminates with a call to function exit or function abort.
1.are called
2.are inherited
3.are not called
4. are created
For automatic objects, constructors and destructors are called each time the objects
1.enter and leave scope
2. inherit parent class
3.are constructed
4.are destroyed
How many times a constructor is called in the life-time of an object?
1.Only once
2.Twice
3.Thrice
4.Depends on the way of creation of object
If the copy constructor receives its arguments by value, the copy constructor would
1.call one-argument constructor of the class
2.work without any problem
3.call itself recursively
4.call zero-argument constructor
A constructor that accepts __________ parameters is called the default constructor.
1.one
2.two
3.no
4.three
What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
1.Compile-time error.
2.Preprocessing error.
3.Runtime error.
4.Runtime exception.
When are the Global objects destroyed?
1.When the control comes out of the block in which they are being used.
2.When the program terminates.
3.When the control comes out of the function in which they are being used.
4.As soon as local objects die.
Which constructor function is designed to copy objects of the same class type?
1.Create constructor
2.Object constructor
3.Dynamic constructor
4.Copy constructor
Which of the following are NOT provided by the compiler by default?
1.Zero-argument Constructor
2.Destructor
3.Copy Constructor
4.Copy Destructor
Which of the following cannot be declared as virtual?
1.Constructor
2.Destructor
3.Data Members
4.Both A and C
Which of the following gets called when an object goes out of scope?
1.constructor
2.destructor
3.main
4.virtual function
Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?
1.Preprocessor
2.Linker
3.Loader
4.Compiler
Which of the following never requires any arguments?
1.Member function
2. Friend function
3.Default constructor
4.const function
Which of the following statement is correct about constructors?
1.A constructor has a return type.
2.A constructor cannot contain a function call.
3.A constructor has no return type.
4.A constructor has a void return type.
Which of the following statement is correct about destructors?
1.A destructor has void return type.
2.A destructor has integer return type.
3.A destructor has no return type.
4.A destructors return type is always same as that of main().
Which of the following statement is correct whenever an object goes out of scope?
1. The default constructor of the object is called.
2.The parameterized destructor is called.
3.The default destructor of the object is called.
4.None of the above.
Which of the following statement is correct?
1.A constructor of a derived class can access any public and protected member of the base class.
2.Constructor cannot be inherited but the derived class can call them.
3.A constructor of a derived class cannot access any public and protected member of the base class.
4. Both A and B.
Which of the following statement is correct?
1.Constructor has the same name as that of the class.
2.Destructor has the same name as that of the class with a tilde symbol at the beginning.
3.Both A and B.
4. Destructor has the same name as the first member function of the class.
Which of the following statement is correct?
1.Destructor destroys only integer data members of the object.
2.Destructor destroys only float data members of the object.
3. Destructor destroys only pointer data members of the object.
4.Destructor destroys the complete object.
Which of the following statement is correct?
1.A destructor has the same name as the class in which it is present.
2.A destructor has a different name than the class in which it is present.
3.A destructor always returns an integer.
4.A destructor can be overloaded.
Which of the following statement is correct?
1.A constructor has the same name as the class in which it is present.
2. A constructor has a different name than the class in which it is present.
3. A constructor always returns an integer.
4.A constructor cannot be overloaded.
Which of the following statement is incorrect?
1.Constructor is a member function of the class.
2.The compiler always provides a zero argument constructor.
3.It is necessary that a constructor in a class should always be public.
4. Both B and C.
________ used to make a copy of one class object from another class object of the same class type.
1.constructor
2.copy constructor
3.destructor
4.default constructor