What does the following print?
import java.time.*; import java.time.format.*; public class Main { public static void main(String[] args) { LocalDate polarBearDay = LocalDate.of(2020, 2, 27); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy dd MMM"); System.out.println(polarBearDay.format(formatter)); } /* w ww . j a v a 2 s . co m*/ }
B.
LocalDate starts counting months from one, so month 2 is February.
This rules out Options A and C.
The pattern specifies that the date should appear before the month, making Option B correct.