When an object is created which function will be automatically invoked ?
Friend function
Destructor function
Static function
Constructor function
Which of the following is an advantage of using destructors?
Avoid confusions.
Reduce complexity.
Ensures reusability.
Releases memory space.
Which of the following statement is correct ?
Destructor has the same name as that of the class with a tilde symbol.
Constructor has the same name as that of the class.
Both a and b
Destructor has the same name as the first member function of the class.
What is the correct syntax to assign an object ob1 to ob2 of a class 'read' using copy constructor?
ob2=ob1;
ob2=read(ob1);
read(ob2,ob1);
read ob2(ob1);
Which of the following is used in copy constructor to receive its arguments ?
Either pass-by-value or pass-by-reference
Only pass-by-value
Only pass-by-reference
Only pass-by-address
Which keyword is used to create a constant object?
Constant
const
final
just object name and parameters are needed.
What is the sign used in the declaration of destructor ?
!
?
#
~
What is called default constructor ?
A constructor that accepts one parameter
A constructor that accepts two parameters
A constructor that accepts no parameter
A constructor that accepts three parameters
Which of the following will make the invocation of the object constructor-"read(int x,int y=3){ }" ?
read ob();
read ob(2);
read ob(2.0);
none of these.
What do you meant by dynamic initialization of object?
Initial value of object passed at compile time.
Initial value of object passed at run time.
No initial value needed.
static initialization of objects.