分类: Java
2008-08-10 22:53:53
代码
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javatutorials;
/**
*
* @author wanpor
*/
enum Month{
Jan,
Feb,
Mar,
Apr,
May,
Jun,
Jul,
Aug,
Sep,
Oct,
Nov,
Dec,
}
public class EnumClass {
static final int MONTH_LEN = 12;
static Month month = Month.Jan;
public static void main(String[] args){
System.out.println(month);
}
}
说明
1. 枚举类型的定义;
2. 枚举类型的初始化
3. 不可以转化为int类型
|