public class EnumTest { public static void main(String[] args) { Size s = Size.SMALL; Size t = Size.LARGE; System.out.println(s==t); System.out.println(s.getClass().isPrimitive()); Size u = Size.valueOf("SMALL"); System.out.println(s==u); for (Size value:Size.values()){ System.out.println(value); } } } enum Size{SMALL, MEDIUM, LARGE};