package com.abin.lee.collection.enumer;
public class ChangeType {
public static enum stype{
CHINA("china"),JAPAN("japan"),GERMAN("german");
private String textVal;
private stype(String textVal){
this.textVal=textVal;
}
public String toString(){
return textVal;
}
}
public static void main(String[] args) {
String abin=stype.CHINA.toString();
System.out.println(abin);
stype abing=stype.valueOf("CHINA");//注意这里不应该传china、japan、german,必须传CHINA,JAPAN,GERMAN
System.out.println("abing="+abing);
}
}