Object Oriented Programming interview questions part 3

Object Oriented Programming interview questions part 3

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. Abstraction can apply to:

Correct Answer is : Control and data

2. Which among the following can be viewed as combination of abstraction of data and code.

Correct Answer is : Object

3. Abstraction principle includes___________

Correct Answer is : Use abstraction whenever possible to avoid duplication

4. Higher the level of abstraction, higher are the details.

Correct Answer is : FALSE

5. Encapsulation and abstraction differ as:

Correct Answer is : Binding and Hiding respectively

6. In terms of stream and files________

Correct Answer is : Abstraction is called a stream and device is called a file

7. If two classes combine some private data members and provides public member functions to access and manipulate those data members. Where is abstraction used?

Correct Answer is : Using public member functions to access and manipulate the data members

8. A phone is made up of many components like motherboard, camera, sensors and etc. If the processor represents all the functioning of phone, display shows the display only, and the phone is represented as a whole. Which among the following have highest level of abstraction?

Correct Answer is : Phone

9. Which among the following is not a level of abstraction:

Correct Answer is : External level

10. Using higher degree of abstraction __________

Correct Answer is : Can be safer

11. How many types of access specifiers are provided in OOP (C++)?

Correct Answer is : 3

12. Which among the following can be used together in a single class?

Correct Answer is : All three together

13. Which among the following can restrict class members to get inherited?

Correct Answer is : Private

14. Which access specifier is used when no access specifier is used with a member of class (java)?

Correct Answer is : Default

15. Which specifier allows a programmer to make the private members which can be inherited?

Correct Answer is : Protected

16. Which among the following is false?

Correct Answer is : Default members can’t be inherited

17. If a class has all the private members, which specifier will be used for its implicit constructor?

Correct Answer is : Public

18. f 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 object of class B.

Correct Answer is : Private, protected and public members of class A

19. Which access specifier should be used in a class where the instances can’t be created?

Correct Answer is : All private constructors

20. On which specifier’s data, does the size of a class’s object depend?

Correct Answer is : All the data members are added

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon