Overloaded methods can change return types;
overridden methods cannot, except in the case of covariant returns.
Overloading means reusing a method name, but with different arguments.
Overloaded methods May have different return types, if argument lists are also different
Overloaded methods May have different access modifiers
Overloaded methods May throw different exceptions
Methods from a superclass can be overloaded in a subclass.
Polymorphism applies to overriding, not to overloading.
public void changeSize(int size, String name, float pattern) { }
The following methods are legal overloads of the changeSize() method:
public void changeSize(int size, String name) { }
public int changeSize(int size, float pattern) { }
public void changeSize(float pattern, String name)throws IOException { }
The following are all different methods:
public void aMethod(String s) { }
public void aMethod() { }
public void aMethod(int i, String s) { }
public void aMethod(String s, int i) { }
Only the argument types are considered, not their names
public void aMethod(int j, String name) { } would not be distinguished from
public void aMethod(int i, String s) { }.