You are on page 1of 2

DAY 5

1. What do you mean by Reusability?


2. What do you mean by Inheritance?
3. Explain the types of Inheritance with proper diagram those are supported by Java.
4. Write the syntax of each types of Inheritance.
5. What is keyword used for inheritance? What is the meaning of that?
6. What do you mean by “A PART OF A” or “HAS A”?
7. What do you mean by “A KIND OF A” or “IS A”?
8. What do you mean by access specifier? What do you mean ‘public’, ‘private’,
‘protected’, ‘friendly’ and ‘default’?
9. Give one example for Single Level Inheritance?
10. Give one example for Multi-Level Inheritance?
11. Give one example for Hierarchical Inheritance?
12. Write a Program for the following Diagram:

Employee
+id: int
+name: String
+address: String

-Emp ()
-getEmp ()

Officer Officer

+basic: int +basic: int


+grade: String +grade: String

-Officer () -Officer ()
-getOfficer () -getOfficer ()

HOD Faculty Admin Security

+da: int +da: int +da: int +days: int


+hra: String +topic: String +section: String +wages: int
-HOD () -Faculty () -Admin () -Security ()
-getHod () -getFaculty () -getadmin () -getSecurity ()
-calSal () -calSal (0 -calSal () -calSal ()
13. Explain the role of Constructor in Inheritance with an example.
14. Explain what happen with the derive class if delete the base class after calling the
methods of base class using derive class object and vice versa?
15. What is the difference between Inheritance and Encapsulation?
16. What is the difference between Inheritance and Abstraction?
17. What is the difference between Composition and Inheritance in OOP?
18. What is the Liskov substitution principle? Explain with an example.
19. How to call a method of a subclass, if you are holding an object of the subclass in a
reference variable of type superclass?
20. What happen if we extend a final class? Explain with An example.

You might also like