package com.memorynotfound.text;
import java.text.DateFormatSymbols;
import java.util.Arrays;
import java.util.Locale;
public class DisplayMonthNames {
// DateFormatSymbols in default Locale
private static final DateFormatSymbols dfs = new DateFormatSymbols();
// DateFormatSymbols in pre defined Locale
private static final DateFormatSymbols french_dfs = new DateFormatSymbols(Locale.FRENCH);//格式1
//private static final DateFormatSymbols french_dfs = new DateFormatSymbols(new Locale("en","US");//格式二
public static void main(String... args){
String[] months = dfs.getMonths();
System.out.printf("List of months: ");
System.out.println(Arrays.toString(months));
String[] shortMonths = dfs.getShortMonths();
System.out.printf("List of short months: ");
System.out.println(Arrays.toString(shortMonths));
String[] frenchMonths = french_dfs.getMonths();
System.out.printf("List of french months: ");
System.out.println(Arrays.toString(frenchMonths));
String[] frenchShortMonths = french_dfs.getShortMonths();
System.out.printf("List of french short months: ");
System.out.println(Arrays.toString(frenchShortMonths));
}
}