표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
import java.time.*; import java.time.temporal.*; public class prog { public static void main(String[] args){ LocalTime present = LocalTime.now(); System.out.println("현재 시간은 " + present.get(ChronoField.HOUR_OF_DAY) + "시입니다."); LocalTime otherTime = present.plus(2, ChronoUnit.HOURS); System.out.println("바뀐 시간은 " + otherTime.getHour() + "시입니다."); LocalTime anotherTime = present.minus(6, ChronoUnit.HOURS); System.out.println("바뀐 시간은 " + anotherTime.getHour() + "시입니다."); } }