Method Overloading in Java refers to having more than one method with same name but with different types and different number of parameters.
When we require to perform the same functionality and behavior on different sets of inputs then we use method overloading.
Example:-
Students aspire to become Engineer , Scientist , Doctor , Astronaut , Teacher , Biologist , Actor etc. Now for each of the profession you have to study but for each profession the subjects you study is different. Now the knowledge and education of an actor will be quite different from that of a scientist but both are working their own professional lives.
Knowledge & Education ( Input ) → Profession ( Output )
PCM (Non-medical) → Enginner
PCB (Medical) → Doctor
Method Overriding in Java refers to overriding the generic (default) behavior and functionality of method in the child class as per its own tailor made custom requirements. It refers to take a general approach to specialization.
We perform overriding when we need to perform some specific customized set of operations with the available input sets of data after inheriting it from the base class.
Example:-
The tradition , culture and rituals we inherit from our ancestors and customized by us to the present scenario and needs is a live example of method overriding!