OnJava8-Examples/enumerated/NotClasses.java

28 lines
708 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: enumerated/NotClasses.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
// {Exec: javap -c LikeClasses}
import static net.mindview.util.Print.*;
enum LikeClasses {
2015-05-05 11:20:13 -07:00
WINKEN {@Override
void behavior() { print("Behavior1"); } },
BLINKEN {@Override
void behavior() { print("Behavior2"); } },
NOD {@Override
void behavior() { print("Behavior3"); } };
2015-04-20 15:36:01 -07:00
abstract void behavior();
}
public class NotClasses {
// void f1(LikeClasses.WINKEN instance) {} // Nope
2015-05-18 23:05:20 -07:00
} /* Output: (First 7 Lines)
2015-04-20 15:36:01 -07:00
Compiled from "NotClasses.java"
abstract class LikeClasses extends java.lang.Enum{
public static final LikeClasses WINKEN;
public static final LikeClasses BLINKEN;
public static final LikeClasses NOD;
...
*///:~