java中 foreach遍历枚举enum中的元素

public class EnumOrder {
	public static void main(String[] args) {
		for (Spiciness s : Spiciness.values())
			System.out.println(s + ", ordinal " + s.ordinal());
	}
}


 

你可能感兴趣的:(java,String,Class)