jdk-24/langtools/test/tools/javac/NonStaticFieldExpr3.java
2007-12-01 00:00:00 +00:00

16 lines
327 B
Java

/* @test /nodynamiccopyright/
@bug 4087127 4785453
@author dps
@summary class: instance access through types is not allowed
@run shell NonStaticFieldExpr3.sh
*/
class NonStaticFieldExpr3 {
public int x;
}
class Subclass extends NonStaticFieldExpr3 {
int a = NonStaticFieldExpr3.x; // SHOULD BE ERROR
}