The following code:
class C {
public void r(String s) {
}
public void r(int s) {
}
public static void main(String[] args) {
String s = "test";
C c = new C();
c.r(s);
}
}
breaks with the error RuntimeError: Class String not declared.
The error occurs during overloading resolution; and is because isSubtype does not handle primitives properly at all.