-
Bug
-
Resolution: Duplicate
-
P5
-
None
-
5.0
-
generic
-
generic
The compiler generates the wrong error message when presented with this illegal program:
public class Bar {
public static void main(String[] args) {
}
final static void foo() {
}
}
class Eek extends Bar {
static void foo() {
}
}
It says:
javac Bar.java
Bar.java:9: foo() in Eek cannot override foo() in Bar; overridden method is static final
static void foo() {
^
1 error
The word "overridden" should be replaced by "hidden."
public class Bar {
public static void main(String[] args) {
}
final static void foo() {
}
}
class Eek extends Bar {
static void foo() {
}
}
It says:
javac Bar.java
Bar.java:9: foo() in Eek cannot override foo() in Bar; overridden method is static final
static void foo() {
^
1 error
The word "overridden" should be replaced by "hidden."
- duplicates
-
JDK-6249774 hide vs override error message
- Open