Explore topic-wise MCQs in Object Oriented Programming.

This section includes 21 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.

Assigning objects takes place while passing the arguments.

A. True
B. False
Answer» C.
2.

Assigning reference to an object _________________

A. Will create another copy of the object
B. Will create two different copies of the object
C. Will not create any other copy of the object
D. Will not refer to the object
Answer» D. Will not refer to the object
3.

How to make more than one object refer to the same object?

A. Initialize it to null
B. Initialize the object with another at declaration
C. Use constructor to create new object
D. Assign the address directly
Answer» C. Use constructor to create new object
4.

If more than one object refer to the same address, any changes made __________

A. Can be made visible to specific objects
B. Will be specific to one object only
C. From any object will be visible in all
D. Doesn’t changes the values of all objects
Answer» D. Doesn’t changes the values of all objects
5.

Use of assignment operator ____________________

A. Changes its use, when used at declaration and in normal assignment
B. Doesn’t changes its use, whatever the syntax might be
C. Assignment takes place in declaration and assignment syntax
D. Doesn’t work in normal syntax, but only with declaration
Answer» B. Doesn’t changes its use, whatever the syntax might be
6.

How many objects can be assigned to a single address?

A. Only 1
B. At most 7
C. At most 3
D. As many as required
Answer» E.
7.

In copy constructor definition, if non const values are accepted only ________

A. Only const objects will be accepted
B. Only non – const objects are accepted
C. Only const members will not get copied
D. Compiler generates an error
Answer» C. Only const members will not get copied
8.

Declaring a copy constructor doesn’t suppresses the compiler generated copy assignment operator.

A. True
B. False
Answer» B. False
9.

If programmer doesn’t define any copy assignment operator then ____________________

A. Compiler gives an error
B. Program fails at run time
C. Compiler gives an implicit definition
D. Compiler can’t copy the member values
Answer» D. Compiler can’t copy the member values
10.

Predict the output of the program.

A. 10
B. 20
C. 21
D. 0View Answer
Answer» C. 21
11.

How the argument passed to a function get initialized?

A. Assigned using copy constructor at time of passing
B. Copied directly
C. Uses addresses always
D. Doesn’t get initialized
Answer» B. Copied directly
12.

If an object is created and another object is assigned to it, then ________________

A. Copy constructor is called to copy the values
B. Object is copied directly to the object
C. Reference to another object is created
D. The new object is initialized to null values
Answer» D. The new object is initialized to null values
13.

When value of an object is assigned to another object ________________

A. It becomes invalid statement
B. Its values gets copied into another object
C. Its values gets address of the existing values
D. The compiler doesn’t execute that statement
Answer» C. Its values gets address of the existing values
14.

HOW_MANY_OBJECTS_CAN_BE_ASSIGNED_TO_A_SINGLE_ADDRESS??$

A. Only 1
B. At most 7
C. At most 3
D. As many as required
Answer» B. At most 7
15.

If more than one object refer to the same address, any changes made$

A. Can be made visible to specific objects
B. Will be specific to one object only
C. From any object will be visible in all
D. Doesn’t changes the values of all objects
Answer» C. From any object will be visible in all
16.

Use_of_assignment_operator_____________________$

A. Changes its use, when used at declaration and in normal assignment
B. Doesn’t changes its use, whatever the syntax might be
C. Assignment takes place in declaration and assignment syntax
D. Doesn’t work in normal syntax, but only with declaration
Answer» D. Doesn‚Äö√Ñ√∂‚àö√ë‚àö¬•t work in normal syntax, but only with declaration
17.

We can assign ______________________

A. Value of one reference variable to another
B. Value of any object to another
C. Value of any type to any object
D. Value of non – reference to another reference
Answer» D. Value of non ‚Äö√Ñ√∂‚àö√ë‚àö¬® reference to another reference
18.

How_to_make_more_than_one_object_refer_to_the_same_object?

A. Initialize it to null
B. Initialize the object with another at declaration
C. Use constructor to create new object
D. Assign the address directly
Answer» B. Initialize the object with another at declaration
19.

In copy constructor definition, if non const values are accepted only _______?

A. Only const objects will be accepted
B. Only non – const objects are accepted
C. Only const members will not get copied
D. Compiler generates an error
Answer» E.
20.

Declaring a copy constructor doesn’t suppresses the compiler generated copy assignment operator.$

A. True
B. False
Answer» C.
21.

If programmer doesn’t define any copy assignment operator then ____________________$

A. Compiler gives an error
B. Program fails at run time
C. Compiler gives an implicit definition
D. Compiler can’t copy the member values
Answer» B. Program fails at run time