표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
import java.util.*; import java.util.stream.*; public class prog { public static void main(String[] args){ Stream<String> stream = Stream.of("HTML", "CSS", "JAVA", "PHP"); Map<Boolean, List<String>> patition = stream.collect(Collectors.partitioningBy(s -> (s.length() % 2) == 0)); List<String> oddLengthList = patition.get(false); System.out.println(oddLengthList); List<String> evenLengthList = patition.get(true); System.out.println(evenLengthList); } }