What is the difference between override and overload?
On interesting thing to mention:
public static doSomething(Collection> c) {
// do something
}
public static doSomething(ArrayList> l) {
// do something
}
public static void main(String[] args) {
Collection c = new ArrayList ();
doSomething(c); // which method get's called?
}
One would suppose the method with the ArrayList argument would be called but it doesn't. The first method is called since the proper method is selected at compile time.