// File: SuperClass.java
public class SuperClass {
public static int func() {
return 0;
}
}
// File: SubClass.java
public class SubClass extends SuperClass {
public static boolean func() {
return false;
}
}
$ javac -fullversion
javac full version "1.6.0_15-b03-226"
javac SuperClass.java SubClass.java
SubClass.java:2: func() in SubClass cannot override func() in SuperClass; attempting to use incompatible return type
found : boolean
required: int
public static boolean func() {
^
1 error
The subclass uses a different return type for the same named method with same argument types. So, it is overloading SuperClass.func() and the overloading SubClass.func() differs only in return type. But, I am not sure of the error message....