Unit-III Session 24 Overriding Abstract Classes
Unit-III Session 24 Overriding Abstract Classes
UNIT 3
If subclass (child class) has the same method as declared in the parent class, it is known
as method overriding in Java.
In other words, If a subclass provides the specific implementation of the method that
has been declared by one of its parent class, it is known as method overriding.
Let's understand the problem that we may face in the program if we don't use method
overriding.
16. }
Test it Now
Output:
Vehicle is running
Output:
Output:
SBI Rate of Interest: 8
ICICI Rate of Interest: 7
AXIS Rate of Interest: 9
Method overloading is performed within Method overriding occurs in two classes that
2)
class. have IS-A (inheritance) relationship.
Method overloading is the example of Method overriding is the example of run time
4)
compile time polymorphism. polymorphism.