What is the output of the following code?
LocalDateTime d = LocalDateTime.of(2015, 5, 10, 11, 22, 33); Period p = Period.ofDays(1).ofYears(2); d = d.minus(p); DateTimeFormatter f = DateTimeFormatter. ofLocalizedDateTime(FormatStyle.SHORT); System.out.println(f.format(d));
B.
Period does not allow chaining.
Only the last Period method called counts, so only the two years are subtracted.