인터페이스를 구현할 수 있다
  public enum TempEnum implements Closeable{
      ...
  }  
abstract 메소드를 가질수 있지만 각각의 enum 필드에서 구현해줘야 한다
  public enum TempEnum {
      START(1){
          @Override
          public String getDetail() {
              return "START";
          }
      },
      RUNNING(2){
          @Override
          public String getDetail() {
              return "RUNNING";
          }
      };
      ...
      public abstract String getDetail();
  }  
enum 필드에서 메소드를 override 할 수 있다
  public enum TempEnum {
      START(1){
          @Override
          public String toString(){
              return "START";
          }
      },
      RUNNING(2);
      ...
      @Override
      public String toString(){
          return "toString";
      }
  }  
String으로 입력받은 enum의 이름을 enum 객체로 리턴해준다
  public enum TempEnum {
      START(1), RUNNING(2);
      ...
  }  
  ...
  TempEnum enumVar1 = TempEnum.valueOf("START");
  TempEnum enumVar2 = TempEnum.valueOf("RUNNING");
public static <T extends Enum<T>> T valueOf(Class<T> enumType, String name) {
	
	T result = enumType.enumConstantDirectory().get(name);
	if (result != null)
		return result;
	if (name == null)
		throw new NullPointerException("Name is null");
	
	throw new IllegalArgumentException("No enum const " + enumType +"." + name);
}
Map<String, T> enumConstantDirectory() {
	if (enumConstantDirectory == null) {
		T[] universe = getEnumConstantsShared();
		if (universe == null)
			throw new IllegalArgumentException(getName() + " is not an enum type");
		
		Map<String, T> m = new HashMap<String, T>(2 * universe.length);
		for (T constant : universe)
			m.put(((Enum)constant).name(), constant);
		enumConstantDirectory = m;
	}
	return enumConstantDirectory;
} 
String을 입력받아서 enum의 valueOf로 enum객체를 가져오는 것과 if로 String을 비교하여 enum을 가져오는 것을 비교하면 enum의 valueOf가 더욱 빠른 성능을 보인다
  public enum TestEnum {
      A1("A1"),
      A2("A2"),
      ...
      A500("A500");
      private String code; 
	
      private Test(String code) {
          this.code = code;
      }
	
      public String getCode() {
          return code;
      }
  }
  ---------------------------------------------------
  long startTime = System.currentTimeMillis();
  for (int i = 0; i < 100000000L; i++) {
      Test testEnum = Test.valueOf("A10");
  }
  long endTime = System.currentTimeMillis();
  System.out.println(endTime - startTime);	 // 261ms
  ---------------------------------------------------
	
  String key = "A10";
  long startTime = System.currentTimeMillis();
  for (int i = 0; i < 100000000L; i++) {
      if ("A1".equals(key)) {
          Test testEnum = Test.A1;
      } else if ("A2".equals(key)) {
          Test testEnum = Test.A2;
      } else if ( ... ) {
          ...
      } else if ("A10".equals(key)) {
          Test testEnum = Test.A10;
      } 
  }
  long endTime = System.currentTimeMillis();
  System.out.println(endTime - startTime);	 // 449ms
-전---------------------------------------------------
private final int TYPE_A = 1;
private final int TYPE_B = 2;
private final int TYPE_C = 3;
...
private final int TYPE_G = 7;
int type= getType(); // 무조건 1~7만 리턴하는 함수
// 각 type 에 맞는 String을 리턴 
if (type == TYPE_A) {
	return "TYPE_A";
} else if (type == TYPE_B) {
	return "TYPE_B";
} else if (...) {
	return "TYPE_...";
} else if (type == TYPE_G) {
	return "TYPE_G";
}
-후---------------------------------------------------
public enum NumberEnum {
	_1("TYPE_A"), _2("TYPE_B"), ... _7("TYPE_G");
	private String type;
	private NumberEnum(int type) {
		this.type = type;
	}
	
	public static NumberEnum valueOf(int number) {
		return NumberEnum.valueOf("_" + String.valueOf(number));
	}
}
int type= getType(); // 무조건 1~7만 리턴하는 함수
// Enum을 이용하면 if 문 없이 한줄로 처리 가능  
return NumberEnum.valueOf(type);
-전---------------------------------------------------
private final int TYPE_A = 1;
private final int TYPE_B = 2;
private final int TYPE_C = 3;
...
private final int TYPE_G = 7;
int type= getType(); // 무조건 1~7만 리턴하는 함수
// 각 type 에 맞는 String을 리턴 
if (type == TYPE_A) {
	return "TYPE_A";
} else if (type == TYPE_B) {
	return "TYPE_B";
} else if (...) {
	return "TYPE_...";
} else if (type == TYPE_G) {
	return "TYPE_G";
} else {
	return "NONE";
}
-후---------------------------------------------------
public enum NumberEnum {
	_1("TYPE_A"), _2("TYPE_B"), ... _7("TYPE_G");
	private String type;
	private NumberEnum(int type) {
		this.type = type;
	}
	
	public static NumberEnum valueOf(int number) {
		return NumberEnum.valueOf("_" + String.valueOf(number));
	}
}
int type= getType(); // 무조건 1~7만 리턴하는 함수
// valueOf에서 없는 키값을 찾으려하면 IllegalArgumentException이 발생
try {
	return NumberEnum.valueOf(type);
} catch (IllegalArgumentException e) {
	return "NONE"
}