1. Inheritance allows us to derive a new class (subclass) from an existing class (superclass). The subclass inherits the attributes and methods of the superclass.
2. If the same method is defined in both the superclass class and the subclass class, then _____________________.
3. Method overriding is when the:
4. What is the output of the following code?
5. To override an inherited method, the method in the child class __________________________________.
6. You may see the @Override annotation above a method. This is _______________________.
7. Overloading a method is when several methods have the same name but the parameter types, order, or number are different.
8. In overloading, only the method names are identical and they have different parameters.
9. What is the output of the following code?
10. In the example above the speak(String who) method ______________the speak() method of Hello.
11. In the example provided in question 9, Goodbye does not inherit any method and is therefore overriden.
12. A subclass is usually designed to have modified (overridden) or additional methods or instance variables.
13. What is the output of the following code?
14. In the above program, the ___________ is present in both the Animal superclass and the Dog subclass
15. Can we access the method of the superclass after overriding?