What is the result of the following?.
public class PiDay { public static void main(String[] args) { LocalDateTime pi = LocalDateTime.of(2017, 3, 14, 1, 59); DateTimeFormatter formatter = DateTimeFormatter .ofPattern("m.ddhhMM"); System.out.println(formatter.format(pi)); } }
D.
While this code misuses formatting characters, it does compile and run successfully, making Options E and F incorrect.
A lowercase m represents the minutes, which are 59 in this case, ruling out Options A and B.
The rest of the code prints the date, hour, and month.
This gives the value 59.140103, making Option D the answer.