少年阿宾

那些青春的岁月

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
package com.abin.lee.collection.inner;
public class XiXiang {
public static enum IdType{
ONE("one"),TWO("two"),THREE("three");
private String textVal;
private IdType(String textVal){
this.textVal=textVal;
}
private String getString(){
return textVal;
}
}
public static String get(IdType type,String id){
String status=null;
final class get{
String result=null;
public String getName(String id){
if(id.equals("1")){
result="lee";
}
return result;
}
}
if(type==IdType.valueOf("ONE")){
status=new get().getName(id);
}
return status;
}
public static void main(String[] args) {
String id="1";
IdType type=IdType.valueOf("ONE");
String result=new XiXiang().get(type,id);
System.out.println("result="+result);
}
}
posted on 2012-09-02 18:00 abin 阅读(2364) 评论(0)  编辑  收藏 所属分类: Java内部类JavaEnum

只有注册用户登录后才能发表评论。


网站导航: