When a Sub class has the implementation of the same method which is defined in the Parent class then it is called as Method Overriding. Unlike Method Overloading in Java the parameters passed will not differ in Overriding. Lets now look in how to Override a method in Java. [Read more…]
Method Overloading in Java allows you to have two or more methods with same method name but with difference in the parameters. [Read more…]
Polymorphism is the ability to take more than one form. Polymorphism is one of the most important concept in OOPS ( Object Oriented Programming Concepts). Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class.
In Java, there are 2 ways by which you can achieve polymorphic behavior
1. Method Overloading
2. Method Overriding [Read more…]