Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ssh
- web.xml
- IntelliJ
- 단축키
- 네트워크
- JavaScript
- plugin
- vscode
- bash
- grep
- resource
- Windows 10
- Mac
- 줄바꿈 문자
- profile
- tomcat
- maVen
- lsof
- VirtualBox
- xargs
- port
- netsh
- find
- Source
- Quartz
- GIT
- import
- Windows
- context
- Eclipse
Archives
- Today
- Total
develog
enum 본문
public enum WeekDay {
SUNDAY(0, "일"),
MONDAY(1, "월"),
TUESDAY(2, "화"),
WEDNESDAY(3, "수"),
THURSDAY(4, "목"),
FRIDAY(5, "금"),
SATURDAY(6, "토");
private int code;
private String dayNm;
private WeekDay(int code, String dayNm) {
this.code = code;
this.dayNm = dayNm;
}
public int getCode() {
return code;
}
public String getDayNm() {
return dayNm;
}
}
public class TestEnum {
public static void main(String[] args) throws Exception {
System.out.println("START");
System.out.println("--------------------------------------------");
for (WeekDay weekDay : WeekDay.values()) {
System.out.println(weekDay + ", " + weekDay.getCode() + ", " + weekDay.getDayNm());
}
WeekDay weekDay = WeekDay.TUESDAY;
System.out.println(weekDay + ", " + weekDay.getCode() + ", " + weekDay.getDayNm());
System.out.println("--------------------------------------------");
System.out.println("END");
}
}
'Dev > Java' 카테고리의 다른 글
log4sql (0) | 2013.06.28 |
---|---|
spring pointcut expression syntax (0) | 2013.06.27 |
properties (0) | 2013.06.26 |
String.valueOf(), String.toString() (0) | 2013.06.25 |
현재 클래스 경로 구하기 (0) | 2013.06.19 |
Comments