Module -3
Question Bank:
1. What is inheritance? Discuss different types of inheritance with suitable example.
2. Discuss the behavior of constructors when there is a multilevel inheritance. Give
appropriate code to illustrate the process.
3. Mention and explain the uses of super keyword in Java.
4. How do you pass arguments to superclass constructor through the subclass constructor?
Explain with a code snippet.
5. Write a note on:
a. Object Class
b. Dynamic Method Dispatch
6. Create an abstract class called Employee. Include the members: Name, EmpID and
an abstract method cal_sal(). Create two inherited classes SoftwareEng (with the
members basic and DA) and HardwareEng (with members basic and TA).
Implement runtime polymorphism (dynamic method dispatch) to display salary of
different employees by creating array of references to superclass.
7. Differentiate method overloading and method overriding.
8. What do you mean by method overriding? Discuss with a programming example.
9. Explain abstract class and abstract method with suitable code snippet.
10. Define an interface. Explain how to define and implement an interface with an
example.
11. Differentiate abstract base class and an interface.
12. How do you define variables inside interface? List out the characteristics of such
variables.