enumeration学习
生活随笔
收集整理的這篇文章主要介紹了
enumeration学习
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
import org.junit.Test;
public class enumeration {
@Test
public void test() {
System.out.print(School.name+"--> ");
System.out.print(School.name.getvalue()+" :");
System.out.println(School.name.info());
}
}
enum School {
name("名字") {
public String info() {
return "小杰";
}
},
location("地址") {
public String info() {
return "天津";
}
};
private String value;
private School(String value) {
this.value = value;
}
public String getvalue() {
return this.value;
}
public abstract String info();
}
?
轉載于:https://www.cnblogs.com/sprinng/archive/2012/12/09/2810097.html
總結
以上是生活随笔為你收集整理的enumeration学习的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 自学系列: 常用文件结构
- 下一篇: 求一个搞笑微信网名