jdk-24/langtools/test/tools/javac/enum/FauxEnum3.java
2014-07-07 12:36:45 -07:00

21 lines
408 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5009574
* @summary verify an enum type can't be directly subclassed
* @author Joseph D. Darcy
*
* @compile/fail/ref=FauxEnum3.out -XDrawDiagnostics FauxEnum3.java
*/
public class FauxEnum3 extends SpecializedEnum {
}
enum SpecializedEnum {
RED {
boolean special() {return true;}
},
GREEN,
BLUE;
boolean special() {return false;}
}