Choose the correct option based on this code segment:.
DateTimeFormatter dateFormat = DateTimeFormatter.ISO_DATE; // DEF LocalDate dateOfBirth = LocalDate.of(2015, Month.FEBRUARY, 31); System.out.println(dateFormat.format(dateOfBirth)); // USE
e.
the date value 31 passed in the call LocalDate.of(2015, 2, 31); is invalid for the month February, and hence the of()
method in the LocalDate class throws DateTimeException.
One of the predefined values in DateTimeFormatter is ISO_DATE.
hence, it does not result in a compiler error for the statement marked with the comment DEF.
the statement marked with the comment USE compiles without errors because it is the correct way to use the format()
method in the DateTimeFormatter class.