Choose the correct output in Java8 Innards
LocalDate date1 = LocalDate.now();
LocalDate date2 = date1.plus(1, ChronoUnit.MONTHS);
Period period = Period.between(date2, date1);
System.out.println("Period: " + period);
Choose the correct option from below list
(1)Compilation error
(2)Period: 1
(3)Period: P-1M
(4)Runtime error
Answer:-(3)Period: P-1M | |