Java overloading and overriding

java, oop

Solution

Overloading means two methods or more with the same name but with different parameters just like your example.While Overriding you implement a method from an interface or abstract class so the method in the super class has an implementation and in the subclass has a different one, Still they have the same method name and parameters.

Problem

Suppose i have two methods in a class say `public void eat(int i,String s)` and `public void eat(String s, int i)` then what is it like. Overloading or overriding?

Original source