OOPS MCQ Quiz Hub

OOPS Mcq Question Set 4

Choose a topic to test your knowledge and improve your OOPS skills

Which is the correct condition for function overriding?





✅ Correct Answer: 2

Exactly same declaration in base and derived class includes________





✅ Correct Answer: 4

How to access the overridden method of base class from the derived class?





✅ Correct Answer: 3

The functions to be overridden ____





✅ Correct Answer: 2

Which language doesn’t support the method overriding implicitly?





✅ Correct Answer: 2

In C# ________





✅ Correct Answer: 1

In Delphi _______





✅ Correct Answer: 3

What should be used to call the base class method from the derived class if function overriding is used in Java?





✅ Correct Answer: 1

In Kotlin, the function to be overridden must be ______





✅ Correct Answer: 2

Abstract functions of a base class ______





✅ Correct Answer: 4

If virtual functions are defined in the base class then ________





✅ Correct Answer: 1

Which is private member functions access scope?





✅ Correct Answer: 1

Which among the following is true?





✅ Correct Answer: 2

Which member can never be accessed by inherited classes?





✅ Correct Answer: 1

Which syntax among the following shows that a member is private in a class?





✅ Correct Answer: 3

If private member functions are to be declared in C++ then ________





✅ Correct Answer: 1

In java, which rule must be followed?





✅ Correct Answer: 4

How many private member functions are allowed in a class?





✅ Correct Answer: 4

How to access a private member function of a class?





✅ Correct Answer: 3

Private member functions _______





✅ Correct Answer: 1

Which function among the following can’t be accessed outside the class in java in same package?





✅ Correct Answer: 3

If private members are to be called outside the class, which is a good alternative?





✅ Correct Answer: 1

A private function of a derived class can be accessed by the parent class.





✅ Correct Answer: 1

Which error will be produced if private members are accessed?





✅ Correct Answer: 1

Can main() function be made private?





✅ Correct Answer: 4

If a function in java is declared private then it ______





✅ Correct Answer: 2

What does memory allocation for objects mean?





✅ Correct Answer: 1

When is the memory allocated for an object?





✅ Correct Answer: 3

Using new is type safe as ______





✅ Correct Answer: 2

Which of the following function can be used for dynamic memory allocation of objects?





✅ Correct Answer: 4

How much memory will be allocated for an object of class given below? class Test{ int mark1; int mark2; float avg; char name[10]; };





✅ Correct Answer: 1

When is the memory allocated for an object gets free?





✅ Correct Answer: 2

Which among the following keyword can be used to free the allocated memory for an object?





✅ Correct Answer: 3

Which function is called whenever an object goes out of scope?





✅ Correct Answer: 1

Which operator can be used to check the size of an object?





✅ Correct Answer: 1

The memory allocated for an object ________





✅ Correct Answer: 3

If an object is declared in a user defined function ___________





✅ Correct Answer: 1

In java ________ takes care of managing memory for objects dynamically.





✅ Correct Answer: 4

Which among the following are valid ways of overloading the operators?





✅ Correct Answer: 3

Which among the following is mandatory condition for operators overloading?





✅ Correct Answer: 1

When the operator to be overloaded becomes the left operand member then ______





✅ Correct Answer: 2

If the left operand is pointed by *this pointer, what happens to other operands?





✅ Correct Answer: 4

If a friend overloaded operator have to be changed to member overloaded operator, which operator should be used with the class name?





✅ Correct Answer: 1

What is the syntax to overload an operator?





✅ Correct Answer: 1

Why the left parameter is removed from parameter list?





✅ Correct Answer: 3

Which object’s members can be called directly while overloading operator function is used (In function definition)?





✅ Correct Answer: 1

If left operand member is specified directly in the function definition, which is the correct implicit conversion of that syntax?





✅ Correct Answer: 4

When the friend operator overloading is converted into member operator overloading ____





✅ Correct Answer: 2

Where in the parameter list is the implicit *this is added?





✅ Correct Answer: 3

Which operator among the following can be overloading using only member function?





✅ Correct Answer: 1