MCQs > IT & Programming > Object Oriented Programming (OOP) MCQs > OOP (Object-oriented programming) MCQs

OOP (Object-oriented programming) MCQ

Each object of a class has its own copy of the class's ________.

Answer

Correct Answer: Member variables

Note: This Question is unanswered, help us to find answer for this one

The ________ is used to protect important data.

Answer

Correct Answer: Private access specifier

Note: This Question is unanswered, help us to find answer for this one

Objects are created from abstract data types that encapsulate ________ and ________ together.

Answer

Correct Answer: Data, functions

Note: This Question is unanswered, help us to find answer for this one

Every event object has the _____ method that returns the object that triggered the event.

Answer

Correct Answer: GetSource()

Note: This Question is unanswered, help us to find answer for this one

A class is a(n) _____________ that is defined by the programmer.

Answer

Correct Answer: Data type

Note: This Question is unanswered, help us to find answer for this one

Can I inherit the constructor and destructor of a base class?

Answer

Correct Answer: No

Note: This Question is unanswered, help us to find answer for this one

Can I create new operators using operator overloading?

Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

_____________ is actually a parameterized constructor which takes some parameters in order to create instance of a class.

Answer

Correct Answer: Explicit constructor

Note: This Question is unanswered, help us to find answer for this one

What is a “const member function”?

Answer

Correct Answer: It means the function is only a read-only function

Note: This Question is unanswered, help us to find answer for this one

If the child object can exist beyond the lifetime of its parent, then the relationship is ____________.

Answer

Correct Answer: Aggregation

Note: This Question is unanswered, help us to find answer for this one

__________ allows for the separation of object interactions from classes and inheritance into distinct layers of abstraction.

Answer

Correct Answer: Decoupling

Note: This Question is unanswered, help us to find answer for this one

Which of the following is false for a destructor?

Answer

Correct Answer: None

Note: This Question is unanswered, help us to find answer for this one

Common behavior can be defined in a superclass and inherited into a subclass using the ___________ keyword.

Answer

Correct Answer: Extends

Note: This Question is unanswered, help us to find answer for this one

What are the major elements in an object model?

Answer

Correct Answer: Abstraction, encapsulation and hierarchy

Note: This Question is unanswered, help us to find answer for this one

A recursive function would result in infinite recursion, if the following were left out:

Answer

Correct Answer: Base call

Note: This Question is unanswered, help us to find answer for this one

Constructors never have an explicit return type.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

In dynamic type case a type safety check is incurred at ____________.

Answer

Correct Answer: Run time

Note: This Question is unanswered, help us to find answer for this one

Constructors have to be called before the main function:

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

What is dynamic dispatch?

Answer

Correct Answer: When the function to be executed in response to a function call is determined at run-time

Note: This Question is unanswered, help us to find answer for this one

Which of the following is true for package access modifier?

Answer

Correct Answer: The Class which has a Public Modifier can be accessed by all the classes from the particular package and also from different packages And The class which has private as the modifier cannot be accessed by any class even with in the package

Note: This Question is unanswered, help us to find answer for this one