-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b93
-
generic
-
generic
-
Verified
File: A.java
class A {
static void func() { }
}
File: B.java
class B extends A {
static int func() { return 0; }
}
B.java:2: error: func() in B cannot override func() in A
static int func() { return 0; }
^
return type int is not compatible with void
1 error
The error message should be "func() in B cannot hide func() in A..."
Similarly when A.java is changed to be
class A {
static final void func() { }
}
the error reported is
B.java:2: error: func() in B cannot override func() in A
static int func() { return 0; }
^
overridden method is static,final
1 error
Again, word "override" should have been "hide" and "overridden" should have been "hidden"
class A {
static void func() { }
}
File: B.java
class B extends A {
static int func() { return 0; }
}
B.java:2: error: func() in B cannot override func() in A
static int func() { return 0; }
^
return type int is not compatible with void
1 error
The error message should be "func() in B cannot hide func() in A..."
Similarly when A.java is changed to be
class A {
static final void func() { }
}
the error reported is
B.java:2: error: func() in B cannot override func() in A
static int func() { return 0; }
^
overridden method is static,final
1 error
Again, word "override" should have been "hide" and "overridden" should have been "hidden"