Explore topic-wise MCQs in Object Oriented Programming.

This section includes 19 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

The delete operator __________________________

A. Can be defined for each class
B. Can’t be defined for each class
C. Can be defined globally only
D. Can’t be defined in a program explicitly
Answer» B. Can’t be defined for each class
2.

For objects that are not of class type ______________

A. Global delete operator is invoked
B. Local delete operator is invoked
C. Global user defined function is invoked
D. Local function to delete object is called
Answer» B. Local delete operator is invoked
3.

The delete operator __________________

A. Invokes function operator delete
B. Invokes function defined by user to delete
C. Invokes function defined in global scope to delete object
D. Doesn’t invoke any function
Answer» B. Invokes function defined by user to delete
4.

Which cases among the following produces the undefined result?

A. delete [] on an independent object
B. delete on an object array
C. delete [] on an object and delete on object array
D. Undefined result is never produced
Answer» D. Undefined result is never produced
5.

Which is the correct syntax to delete an array of objects?

A. delete [] objectName;
B. delete * objectName;
C. objectName[] delete;
D. delete objectName[];
Answer» B. delete * objectName;
6.

Which is the correct syntax to delete a single object?

A. delete *objectName;
B. objectName delete;
C. delete objectName;
D. objectName *delete;
Answer» D. objectName *delete;
7.

How many variants of delete operator are available?

A. Only 1
B. Only 2
C. Only 3
D. Only 4
Answer» C. Only 3
8.

If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted.

A. Its value is defined as null
B. Its value is defined as void
C. Its value is defined as 0
D. Its value is undefined
Answer» E.
9.

When delete operator is used ___________________ (If object has a destructor)

A. Object destructor is called after deallocation
B. Object destructor is called before deallocation
C. Object destructor is not used
D. Object destructor can be called anytime during destruction
Answer» C. Object destructor is not used
10.

If delete is used to delete an object which was not allocated using new _______________

A. Then out of memory error arises
B. Then unreachable code error arises
C. Then unpredictable errors may arise
D. Then undefined variable error arises
Answer» D. Then undefined variable error arises
11.

Which type of value has resulted from the delete operator?

A. void
B. void pointer
C. null pointer
D. null
Answer» B. void pointer
12.

Does delete return any value?

A. Yes, positive value
B. Yes, negative value
C. Yes, zero value
D. No
Answer» E.
13.

What is a delete operator?

A. Deallocates a block of memory
B. Deallocates whole program memory
C. Deallocates only primitive data memory
D. Deallocates all the data reserved for a class
Answer» B. Deallocates whole program memory
14.

HOW_MANY_VARIANTS_OF_DELETE_OPERATOR_ARE_AVAILABLE??$

A. Only 1
B. Only 2
C. Only 3
D. Only 4
Answer» C. Only 3
15.

Which is the correct syntax to delete array of objects?$

A. delete [] objectName;
B. delete * objectName;
C. objectName[] delete;
D. delete objectName[];
Answer» B. delete * objectName;
16.

Which is the correct syntax to delete a single object?$

A. delete *objectName;
B. objectName delete;
C. delete objectName;
D. objectName *delete;
Answer» D. objectName *delete;
17.

If delete is applied to an object whose l-value is modifiable, then _______________ after the object is deleted?

A. Its value is defined as null
B. Its value is defined as void
C. Its value is defined as 0
D. Its value is undefined
Answer» E.
18.

Delete operator _________________

A. Can be used on pointers with null value
B. Can be used on pointers with void value
C. Can be used on pointer with value 0
D. Can be used on pointer with any value
Answer» D. Can be used on pointer with any value
19.

If an object is allocated using new operator ____________

A. It should be deleted using delete operator
B. It can’t be deleted using delete operator
C. It may or may not be deleted using delete operator
D. The delete operator is not applicable
Answer» B. It can‚Äö√Ñ√∂‚àö√ë‚àö¬•t be deleted using delete operator