下面代码输出是?
enum AccountType {
SAVING, FIXED, CURRENT;
private AccountType() {
System.out.println("It is a account type");
}
}
class EnumOne {
public static void main(String[] args) {
System.out.println(AccountType.FIXED);
}
} 编译正确,输出:
It is a account type
FIXED编译正确,输出:
It is a account type
It is a account type
FIXED编译正确,输出
It is a account type
It is a account type
It is a account type
FIXED编译正确,输出:
It is a account type
It is a account type
It is a account type
It is a account type
FIXED编译错误