OOPS Set 4
Free Online Best OOPS MCQ Questions for improve your basic knowledge of C++. This OOPS Set 4 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 4.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
When a destructor is called?
A | After the end of object life |
B | Anytime in between object’s lifespan |
C | At end of whole program |
D | Just before the end of object life |
Question 2 |
Which among the following describes a destructor?
A | A special function that is called to free the resources, acquired by the object |
B | A special function that is called to delete the class |
C | A special function that is called anytime to delete an object |
D | A special function that is called to delete all the objects of a class |
Question 3 |
Which among the following is correct for a hierarchical inheritance?
A | One base class can be derived into only 2 classes |
B | Two base classes can be used to be derived into one single class |
C | Two or more classes can be derived into one class |
D | One base class can be derived into other two derived classes or more |
Question 4 |
How many types of access specifiers are provided in OOP (C++)?
A | 1 |
B | 2 |
C | 3 |
D | 4 |
Question 5 |
Which among the following is correct for abstract class destructors?
A | It doesn’t have destructors |
B | It has destructors |
C | It may or may not have destructors |
D | It contains an implicit destructor |
Question 6 |
Can constructors be overloaded in derived class?
A | Yes, always |
B | Yes, if derived class has no constructor |
C | No, programmer can’t do it |
D | No, never |
Question 7 |
Which programming language doesn’t support multiple inheritance?
A | C++ and Java |
B | C and C++ |
C | Java and SmallTalk |
D | Java |
Question 8 |
Which among the following best describes polymorphism?
A | It is the ability for a message/data to be processed in more than one form |
B | It is the ability for a message/data to be processed in only 1 form |
C | It is the ability for many messages/data to be processed in one way |
D | It is the ability for undefined message/data to be processed in at least one way |
Question 9 |
If a class has all the private members, which specifier will be used for its implicit constructor?
A | Private |
B | Default |
C | Protected |
D | Public |
Question 10 |
Which among the following can restrict class members to get inherited?
A | Private |
B | Protected |
C | Public |
D | All three |
Question 11 |
Which among the following is false?
A | Private members can be accessed using friend functions |
B | Member functions can be made private |
C | Default members can’t be inherited |
D | Public members are accessible from other classes also |
Question 12 |
How many basic types of inheritance are provided as OOP feature?
A | 4 |
B | 3 |
C | 2 |
D | 1 |
Question 13 |
What do you call the languages that support classes but not polymorphism?
A | Class based language |
B | Procedure Oriented language |
C | Object-based language |
D | If classes are supported, polymorphism will always be supported |
Question 14 |
Which among the following is correct for multiple inheritance?
A | class student{public: int marks;}s; class stream{int total;}; class topper:public student, public stream{ }; |
B | class student{int marks;}; class stream{ }; class topper: public student{ }; |
C | class student{int marks;}; class stream:public student{ }; |
D | class student{ }; class stream{ }; class topper{ }; |
Question 15 |
Which among the following best defines single level inheritance?
A | A class inheriting a derived class |
B | A class inheriting a base class |
C | A class inheriting a nested class |
D | A class which gets inherited by 2 classes |
Question 16 |
Which among the following can be used together in a single class?
A | Only private |
B | Private and Protected together |
C | Private and Public together |
D | All three together |
Question 17 |
Which among the following best describes constructor overloading?
A | Defining one constructor in each class of a program |
B | Defining more than one constructor in single class |
C | Defining more than one constructor in single class with different signature |
D | Defining destructor with each constructor |
Question 18 |
Which among the following is called first, automatically, whenever an object is created?
A | Class |
B | Constructor |
C | New |
D | Trigger |
Question 19 |
Which among the following is not a necessary condition for constructors?
A | Its name must be same as that of class |
B | It must not have any return type |
C | It must contain a definition body |
D | It can contains arguments |
Question 20 |
Which among the following best describes the constructors?
A | A function which is called whenever an object is referenced |
B | A function which is called whenever an object is created to initialize the members |
C | A function which is called whenever an object is assigned to copy the values |
D | A function which is called whenever an object is to be given values for members |
Question 21 |
Which among the following best describes the Inheritance?
A | Copying the code already written |
B | Using the code already written once |
C | Using already defined functions in programming language |
D | Using the data and functions into derived segment |
Question 22 |
Which specifier allows a programmer to make the private members which can be inherited?
A | Private |
B | Protected and Default |
C | Protected |
D | Public |
Question 23 |
If class A has add() function with protected access, and few other members in public. Then class B inherits class A privately. Will the user will not be able to call _________ from the object of class B.
A | The add() function of class A |
B | Any member of class A |
C | Any function of class A |
D | Private, protected and public members of class A |
Question 24 |
Which among the following best describes destructor?
A | A function which is called just before the objects are destroyed |
B | A function which is called after each reference to the object |
C | A function which is called after termination of the program |
D | A function which is called before calling any member function |
Question 25 |
Which access specifier is used when no access specifier is used with a member of class (java)?
A | Private |
B | Default |
C | Protected |
D | Public |
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!