Runtime polymorphism will be implimented by the help of inheritance-Method Overriding method overriding Declaring a method in the subclass which already exists there in the parent class is known as method overriding.To override a method in a class, another method is created in its subclass that has the same signature(name,return type and parameter list) as the original method. Remember the following point If the method is static, that method cannot be overridden If the method is declared in 'final' keyword that method cannot be overridden Importance of ‘ super’ keyword The super keyword is used to access immediate parent class(base class) properties If methods, variables and constructor are given the same name in the base class and the derived class, the base class property can be accessed using the super keyword.The super keyword should be used in the derived class only.Cannot be used in the main method Method overriding-sample program class Parent { void display()...
بسم الله الرحمن الرحيم
This free site provides basic Java theory notes and simple programs for beginners. It is the best way to learn Java programming for free. best way to learn Java programming for free, best Java notes for beginners, and simple Java programs for practice for beginners.