1.

Choose the correct output in Java8 Innards

Answer»

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



Discussion

No Comment Found