Object Oriented Programming interview questions part 36
Object Oriented Programming interview questions part 36
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which operator can be used to check the size of an object?
Correct Answer is : sizeof(objectName)
2. The memory allocated for an object ____________________
Correct Answer is : Can be static or dynamic
3. If an object is declared in a user defined function __________________
Correct Answer is : Its memory is allocated in stack
4. In java, ____________________ takes care of managing memory for objects dynamically.
Correct Answer is : Garbage collector
5. Which operator can be used to free the memory allocated for an object in C++?
Correct Answer is : delete
6. Which among the following best describes member function overriding?
Correct Answer is : Member functions having same name in base and derived classes
7. Which among the following is true?
Correct Answer is : Inheritance must be done, to use overriding are overridden
8. Which is the correct condition for function overriding?
Correct Answer is : The declaration must be exactly the same in base and derived class
9. Exactly same declaration in base and derived class includes______________
Correct Answer is : All the same return type, name and parameter list
10. Which among function will be overridden from the function defined in derived class below:
class A
{
int i;
void show()
{
cout<<i;
}
void print()
{
cout <<i;
}
};
class B
{
int j;
void show()
{
cout<<j;
}
};
Correct Answer is : show()
11. How to access the overridden method of base class from the derived class?
Correct Answer is : Using scope resolution operator
12. The functions to be overridden _____________
Correct Answer is : Must not be private base class
13. Which language doesn’t support method overriding implicitly?
Correct Answer is : C#
14. In C# ____________________
Correct Answer is : Non- virtual or static methods can’t be overridden
15. In Delphi ______________
Correct Answer is : Method overriding is done with directive override
16. What should be used to call the base class method from the derived class if function overriding is used in Java?
Correct Answer is : Keyword super
17. In Kotlin, the function to be overridden must be ______________
Correct Answer is : Open
18. Abstract functions of a base class _________________
Correct Answer is : Are overridden by the definition in derived class
19. If virtual functions are defined in the base class then _______________
Correct Answer is : It is not necessary for derived classes to override those functions
20. Which feature of OOP is exhibited by the function overriding?