您的位置首页百科知识

JDK6.0的枚举类型怎么定义

JDK6.0的枚举类型怎么定义

1. 枚举类型的例子public class Loop { enum Size { Small, Medium, Large } public static void main(String args[]) { for (Size s : Size.values()) { helper(s); } } private static void helper(Size s) { System.out.println("Size value: " + s); }}