Where are the Java 8 DateTimeFormatters constants defined?
问题 I am looking at the DateTimeFormatter class and I was wondering where are the constants like "M" , "EEE" and "YY" etc are defined. More specifically there should be code like this somewhere given a ChronoField and TextStyle, it should return the DateTimeFormatter string snippet e.g. (ChronoField.MONTH_OF_YEAR, TextStyle.SHORT) should map to the string "MMM" 回答1: After some source digging, I found out that these are pre-defined in a private static final Map , called FIELD_MAP , which is a