What is a possible result of the following?
LocalDate montyPythonDay = LocalDate.of(2020, Month.MAY, 10); LocalTime time = LocalTime.of(5, 40); LocalDateTime dateTime = LocalDateTime.of(montyPythonDay, time); Duration duration = Duration.ofDays(1); LocalDateTime result = dateTime.minus(duration); System.out.println(result);
B.
This code correctly subtracts a day from montyPythonDay
.
It then outputs a LocalDateTime value.
Option A is incorrect because it omits the time.
Option B is correct because it represents one day earlier than the original date and includes a time in the output.