OOPS Set 3
Free Online Best OOPS MCQ Questions for improve your basic knowledge of C++. This OOPS Set 3 test that contains 25 Multiple Choice Questions with 4 options. You have to select the right answer to a question.
Start
Congratulations - you have completed OOPS Set 3.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
Which among the following is true?
A | The abstract functions must be only declared in derived classes |
B | The abstract functions must not be defined in derived classes |
C | The abstract functions must be defined in base and derived class |
D | The abstract functions must be defined either in base or derived class |
Question 2 |
What does a virtual function ensure for an object, among the following?
A | Correct method is called, regardless of the class defining it |
B | Correct method is called, regardless of the object being called |
C | Correct method is called, regardless of the type of reference used for function call |
D | Correct method is called, regardless of the type of function being called by objects |
Question 3 |
Why do we need to handle exceptions?
A | To prevent abnormal termination of program |
B | To encourage exception prone program |
C | To avoid syntax error |
D | To save memory |
Question 4 |
Which is the universal exception handler class?
A | Object |
B | Math |
C | Errors |
D | Exceptions |
Question 5 |
Which among the following is correct?
A | Abstract functions should not be defined in all the derived classes |
B | Abstract functions should be defined only in one derived class |
C | Abstract functions must be defined in base class |
D | Abstract functions must be defined in all the derived classes |
Question 6 |
Where is the memory allocated for the objects?
A | HDD |
B | Cache |
C | RAM |
D | ROM |
Question 7 |
If a file that needs to be opened is not found in the target location then _____________
A | Exception will be produced |
B | Exceptions are not produced |
C | Exception might get produced because of syntax |
D | Exceptions are not produced because of logic |
Question 8 |
Which among the following is true?
A | Inheritance must not be using when overriding is used |
B | Overriding can be implemented without using inheritance |
C | Inheritance must be done, to use overriding are overridden |
D | Inheritance is mandatory only if more than one functions |
Question 9 |
What does memory allocation for objects mean?
A | Actual creation and memory allocation for object members |
B | Creation of member functions |
C | Creation of data members for a class |
D | Actual creation and data declaration for object members |
Question 10 |
Which among the following best describes member function overriding?
A | Member functions having same name in base and derived classes |
B | Member functions having same name in base class only |
C | Member functions having same name in derived class only |
D | Member functions having same name and different signature inside main function |
Question 11 |
Virtual functions are mainly used to achieve _____________
A | Compile time polymorphism |
B | Interpreter polymorphism |
C | Runtime polymorphism |
D | Functions code polymorphism |
Question 12 |
When is the memory allocated for an object?
A | At declaration of object |
B | At compile time |
C | When object constructor is called |
D | When object is initialized to another object |
Question 13 |
How many types of member functions are possible in general?
A | 2 |
B | 3 |
C | 4 |
D | 5 |
Question 14 |
How are abstract functions different from the abstract functions?
A | Abstract must not be defined in base class whereas virtual function can be defined |
B | Either of those must be defined in base class |
C | Different according to definition |
D | Abstract functions are faster |
Question 15 |
Which is the correct condition for function overriding?
A | The declaration must not be same in base and derived class |
B | The declaration must be exactly the same in base and derived class |
C | The declaration should have at least 1 same argument in declaration of base and derived class |
D | The declaration should have at least 1 different argument in declaration of base and derived class |
Question 16 |
Which type of inheritance leads to diamond problem?
A | Single level |
B | Multi-level |
C | Multiple |
D | Hierarchical |
Question 17 |
What is an exception?
A | Problem arising during compile time |
B | Problem arising during runtime |
C | Problem in syntax |
D | Problem in IDE |
Question 18 |
Exactly same declaration in base and derived class includes______________
A | Only same name |
B | Only same return type and name |
C | Only same return type and argument list |
D | All the same return type, name and parameter list |
Question 19 |
Which is the correct syntax of inheritance?
A | class derived_classname : base_classname{ /*define class body*/ }; |
B | class base_classname : derived_classname{ /*define class body*/ }; |
C | class derived_classname : access base_classname{ /*define class body*/ }; |
D | class base_classname :access derived_classname{ /*define class body*/ }; |
Question 20 |
An exception may arise when _______________
A | Input is fixed |
B | Input is some constant value of program |
C | Input given is invalid |
D | Input is valid |
Question 21 |
Simple member functions are ______________________
A | Ones defined simply without any type |
B | Ones defined with keyword simple |
C | Ones that are implicitly provided |
D | Ones which are defined in all the classes |
Question 22 |
Which keyword is used to declare virtual functions?
A | virtual |
B | virt |
C | anonymous |
D | virtually |
Question 23 |
It is ____________________ to define the abstract functions.
A | Mandatory for all the classes in program |
B | Necessary for all the base classes |
C | Necessary for all the derived classes |
D | Not mandatory for all the derived classes |
Question 24 |
Which among the following best defines the abstract methods?
A | Functions declared and defined in base class |
B | Functions only declared in base class |
C | Function which may or may not be defined in base class |
D | Function which must be declared in derived class |
Question 25 |
Virtual function is ______ class function which expected to be redefined in ______ class, so that when reference is made to derived class object using pointer then we can call virtual function to execute ________ class definition version.
A | Base, derived, derived |
B | Derived, Derived, Derived |
C | Base, derived, base |
D | Base, base, derived |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results
There are 25 questions to complete.
← |
List |
→ |
Return
Shaded items are complete.
1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
End |
Return
You have completed
questions
question
Your score is
Correct
Wrong
Partial-Credit
You have not finished your quiz. If you leave this page, your progress will be lost.
Correct Answer
You Selected
Not Attempted
Final Score on Quiz
Attempted Questions Correct
Attempted Questions Wrong
Questions Not Attempted
Total Questions on Quiz
Question Details
Results
Date
Score
Hint
Time allowed
minutes
seconds
Time used
Answer Choice(s) Selected
Question Text
All done
Need more practice!
Keep trying!
Not bad!
Good work!
Perfect!