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 15

 Destructor is a member function whose name is same as the class name but is preceded by a ………..

tilde

hash

dot

 dollor
SHOW ANSWER

A destructor is used to destroy the objects that have been created by a ………………..

object

 class

function

constructor
SHOW ANSWER

 Whenever const objects try to invoke non-const member functions, the compiler …………………

 return zero value

 return null

generate error

return no value
SHOW ANSWER

Allocation of memory to objects at the time of their construction is known as ……………. of objects.

run time construction

dynamic construction

 initial construction

 static construction
SHOW ANSWER

The process of initializing through a copy constructor is known as ……………

copy process

copy registration

 copy initialization

 initialization process
SHOW ANSWER

 ……………….. provides the flexibility of using different format of data at runtime depending upon the situation.

dynamic initialization

 run time initialization

 static initialization

 variable initialization
SHOW ANSWER

An ………………….. with a constructor or destructor cannot be used as a member or a union.

class

 object

 function

 variable
SHOW ANSWER

Can destuctors be private in C++?

Yes

 No
SHOW ANSWER

Like constructors, can there be more than one destructors in a class?

Yes

 No
SHOW ANSWER

Can destructors be virtual in C++?

Yes

 No
SHOW ANSWER

Which among the following is called first, automatically, whenever an object is created?

Class

Constructor

New

Trigger
SHOW ANSWER

Which among the following is not a necessary condition for constructors?

Its name must be same as that of class

It must not have any return type

It must contain a definition body

It can contains arguments
SHOW ANSWER

Which among the following is correct?

class student{ public: int student(){} };

class student{ public: void student (){} };

class student{ public: student{}{} };

class student{ public: student(){} };
SHOW ANSWER

In which access should a constructor be defined, so that object of the class can be created in any function?

Public

Protected

Private

Any access specifier will work
SHOW ANSWER

How many types of constructors are available for use in general (with respect to parameters)?

2

3

4

5

SHOW ANSWER

If a programmer defines a class and defines a default value parameterized constructor inside it.
     He has not defined any default constructor. And then he try to create the object without passing arguments, which among the following will be correct?

It will not create the object (as parameterized constructor is used)

It will create the object (as the default arguments are passed )

It will not create the object ( as the default constructor is not defined )

It will create the object ( as at least some constructor is defined )
SHOW ANSWER

Default constructor must be defined, if parameterized constructor is defined and the object is to be created without arguments.

True

False
SHOW ANSWER

If class C inherits class B. And B has inherited class A. Then while creating the object of class C, what will be the sequence of constructors getting called?

Constructor of C then B, finally of A

Constructor of A then C, finally of B

Constructor of C then A, finally B

Constructor of A then B, finally C
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