Overloaded methods are bind statically (at compile time)
Overridden methods are bind dynamically (at run time)
In Java all non-static, final & private functions are "virtual functions" by default and hence the method invocation depends on run time.
E.g.
public class BindingTest { public static void main(String args[]) { Vehicle vehicle = new Car(); vehicle.start(); Collection c = new ArrayList(); vehicle(c); }}class Vehicle { public void start() { System.out.println("Inside start method of Vehicle"); } public void startAnother(Collection c){ System.out.println("Inside startAnother of Collection"); } public void startAnother(List list){ System.out.println("Inside startAnother of List"); }}class Car extends Vehicle { @Override public void start() { System.out.println("Inside start method of Car"); } }
The output is
Inside start method of Car
Inside startAnother of Collection