Calendar and display name

static Locale[] getAvailableLocales()
Returns an array of all locales for which the getInstance methods of this class can return localized instances.
String getDisplayName(int field, int style, Locale locale)
Returns the string representation of the calendar field value in the given style and locale.
Map<String,Integer> getDisplayNames(int field, int style, Locale locale)
Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values.

The following code displays all locales from Calendar class:


import java.util.Calendar;
import java.util.Locale;

public class Main{
  public static void main(String[] argv){
    Locale[] locales = Calendar.getAvailableLocales();
    for(Locale l: locales){
      System.out.println(l.getDisplayCountry());
    }
  }
}

The output:


Japan
Peru

Japan
...
Sweden
Denmark
Honduras
Home 
  Java Book 
    Essential Classes  

Calendar:
  1. Calendar class
  2. Constants value in Calendar
  3. Create new Calendar instance
  4. Get field value from Calendar
  5. Compare two Calendar values
  6. Calendar and display name
  7. Is lenient
  8. Add/set value to a field and get new calendar value
  9. Convert Calendar value to string value