jdk-24/test/langtools/tools/javac/OverrideChecks/StaticOverride.java

21 lines
421 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
* @bug 4041948 4022450
2007-12-01 00:00:00 +00:00
* @summary javac previously allowed static methods to override non-static
* methods in some cases.
* @author turnidge
2007-12-01 00:00:00 +00:00
*
* @compile/fail/ref=StaticOverride.out -XDrawDiagnostics StaticOverride.java
2007-12-01 00:00:00 +00:00
*/
interface I{
int f();
}
class C {
public static int f() {
return 7;
}
}
class StaticOverride extends C implements I { }