Object Oriented Programming interview questions part 34
Object Oriented Programming interview questions part 34
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which feature of OOP indicates code reusability?
Correct Answer is : Inheritance
2. If a function can perform more than 1 type of tasks, where the function name remains same, which feature of OOP is used here?
Correct Answer is : Polymorphism
3. If different properties and functions of a real world entity is grouped or embedded into a single element, what is it called in OOP language?
Correct Answer is : Encapsulation
4. Which of the following is not feature of pure OOP?
Correct Answer is : Data may/may not be declared using object
5. Which among the following doesn’t come under OOP concept?
Correct Answer is : Platform independent
6. Which feature of OOP is indicated by the following code?
class student{ int marks; };
class topper:public student{ int age; topper(int age){ this.age=age; } };
Correct Answer is : Encapsulation and Inheritance
7. Which feature may be violated if we don’t use classes in a program?
Correct Answer is : Basically all the features of OOP gets violated
8. How many basic features of OOP are required for a programming language to be purely OOP?
Correct Answer is : 7
9. The feature by which one object can interact with another object is:
Correct Answer is : Message Passing
10. ___________ underlines the feature of Polymorphism in a class.
Correct Answer is : Virtual Function
11. Which feature in OOP is used to allocate additional function to a predefined operator in any language?
Correct Answer is : Operator Overloading
12. Which among doesn’t illustrates polymorphism?
Correct Answer is : Function overriding
13. Exception handling is feature of OOP. (True/False)
Correct Answer is : TRUE
14. Which among the following, for a pure OOP language, is true?
Correct Answer is : The language must follow all the rules of OOP
15. OOP provides better security than POP:
Correct Answer is : Always true for any programming language
16. Which among the following best describes constructor overloading?
Correct Answer is : Defining more than one constructor in single class with different signature
17. Can constructors be overloaded in derived class?
Correct Answer is : No, never
18. Does constructor overloading include different return types for constructors to be overloaded?
Correct Answer is : No, constructors doesn’t have any return type
19. Which among the following is possible way to overload constructor?
Correct Answer is : Define default constructor, 1 parameter constructor and 2 parameter constructor
20. Which constructor will be called from the object created in the code below?
class A
{
int i;
A()
{
i=0; cout<<i;
}
A(int x=0)
{
i=x; cout<<I;
}
};
A obj1;