표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
import java.util.OptionalInt; import java.util.stream.*; public class prog { public static void main(String[] args){ IntStream stream1 = IntStream.of(4, 2, 7, 3, 5, 1, 6); IntStream stream2 = IntStream.of(4, 2, 7, 3, 5, 1, 6); OptionalInt result1 = stream1.sorted().findFirst(); System.out.println(result1.getAsInt()); OptionalInt result2 = stream2.sorted().findAny(); System.out.println(result2.getAsInt()); } }