250x250
반응형
Recent Posts
Recent Comments
Link
«   2024/10   »
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
Archives
Today
Total
관리 메뉴

재 현

100일 후의 날짜 본문

Coding test

100일 후의 날짜

본명은이점례 2021. 6. 26. 18:05
728x90

public static void main(String[] args) {

Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE,100);
        StringBuilder sb = new StringBuilder();
        int yyyy = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH);
        int date = cal.get(Calendar.DATE);
        String s = sb.append(yyyy).append("년").append(month).append("월").append(date).append("일").toString(); 
        System.out.print(s);
    
}

728x90

'Coding test' 카테고리의 다른 글

숫자의 표현  (0) 2021.06.29
JadenCase 문자열 만들기  (0) 2021.06.29
같은 숫자는 싫어  (0) 2021.06.24
제일 작은 수 제거하기  (0) 2021.06.24
시저암호  (0) 2021.06.23