Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C++ - QUESTIONS : PART 13

Can a class have virtual destructor?

Yes

No
SHOW ANSWER

Destructor has the same name as the constructor and it is preceded by ______ .

!

?

~
SHOW ANSWER

For automatic objects, constructors and destructors are called each time the objects

enter and leave scope

inherit parent class

are constructed

SHOW ANSWER

Which constructor function is designed to copy objects of the same class type?

Create constructor

Object constructor

Dynamic constructor

Copy constructor
SHOW ANSWER

Which of the following statement is correct?

Constructor has the same name as that of the class.

Destructor has the same name as that of the class with a tilde symbol at the beginning.

Both A and B.

Destructor has the same name as the first member function of the class.
SHOW ANSWER

Which of the following statement is incorrect?

Constructor is a member function of the class.

The compiler always provides a zero argument constructor.

It is necessary that a constructor in a class should always be public.

Both B and C.
SHOW ANSWER

When are the Global objects destroyed?

When the control comes out of the block in which they are being used.

When the program terminates.

When the control comes out of the function in which they are being used.

As soon as local objects die.
SHOW ANSWER

Copy constructor must receive its arguments by __________ .

either pass-by-value or pass-by-reference

only pass-by-value

only pass-by-reference

only pass by address
SHOW ANSWER

 A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

constructor

destructor

function

object
SHOW ANSWER

 A union that has no constructor can be initialized with another union of __________ type.

different

same

virtual

class
SHOW ANSWER

Which of the following gets called when an object goes out of scope?

constructor

destructor

main

virtual function
SHOW ANSWER

Which of the following statement is correct?

Destructor destroys only integer data members of the object.

Destructor destroys only float data members of the object.

Destructor destroys only pointer data members of the object.

Destructor destroys the complete object.
SHOW ANSWER

 __________ used to make a copy of one class object from another class object of the same class type.
 

constructor

copy constructor

destructor

default constructor
SHOW ANSWER

Constructors __________ to allow different approaches of object construction.

cannot overloaded

can be overloaded

can be called

can be nested
SHOW ANSWER

Which of the following statement is correct?

A destructor has the same name as the class in which it is present.

A destructor has a different name than the class in which it is present.

A destructor always returns an integer.

A destructor can be overloaded.
SHOW ANSWER

Which of the following cannot be declared as virtual?

Constructor

Destructor

Data Members

Both A and C
SHOW ANSWER

If the copy constructor receives its arguments by value, the copy constructor would

call one-argument constructor of the class

work without any problem

call itself recursively

call zero-argument constructor
SHOW ANSWER

Which of the following are NOT provided by the compiler by default?

Zero-argument Constructor

Destructor

Copy Constructor

Copy Destructor
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in