types must be the same.
Second, rather than requiring the same (or different) signatures we talk about override-equivalent signatures:
Two methods have override-equivalent signatures if their signatures are the same, or if the erasures of their
signatures are the same.
Using the new definitions, two methods are overloaded if they have the same name and do not have
override-equivalent signatures. Consider this class:
class Base
void m(int x) {}
void m(T t) {}
void m(String s) {}
void m(SingleLinkQueue> q) {}
}
This defines five different overloads of the method m. Replacing each method's signature by its erasure, we
would get the following corresponding set of methods:
void m(int x) {}
void m(Object t) {}
void m(String s) {}
void m(Number n) {}
void m(SingleLinkQueue q) {}
It is an error for a class or interface to declare two methods with the same name and the same signature
erasure. Consequently, trying to define any of the following versions of m in Base would be an error:
void m(Object o) {}
void m(Number n) {}
void m(SingleLinkQueue