Map<String, List<Integer>> map = Stream.of("A", "BB", "CCC") .collect(Collectors.groupingBy(s -> String.valueOf(s.length()), Collectors.mapping(String::length, Collectors.toList()))); System.out.println(map); What is the output? A) 1=[1], 2=[2], 3=[3] B) "1"=[1], "2"=[2], "3"=[3] C) 1=[1], 2=[2] D) Compilation error
LocalDate date = LocalDate.of(2024, Month.FEBRUARY, 29); date = date.plusYears(1); System.out.println(date); A) 2025-02-28 B) 2025-03-01 C) 2025-02-29 (compilation error) D) RuntimeException ikm java 8 test updated
ZonedDateTime zdt = ZonedDateTime.now(ZoneId.of("America/New_York")); LocalDateTime ldt = zdt.toLocalDateTime(); // What is the relationship? Answer: ldt has the same date and time fields but no zone. Misunderstanding can lead to errors when comparing with another ZonedDateTime . The updated test includes code where a lambda captures a loop variable. For example: Map<String, List<Integer>> map = Stream