Java Calendar getAvailableLocales方法


Java Calendar getAvailableLocales方法

package com.codingdict;

import java.util.*;

public class CalendarGetAvailableLocalesEx {
   public static void main(String args[]) {

      // create an object of locale class
      Locale[] array = new Locale[10];

      // get available locales and assign them to array
      array = Locale.getAvailableLocales();

      // print the results
      System.out.println("The first 10 locales installed are :-\n");
      for (int i = 0; i < 10; i++) {
         System.out.println(array[i].getISO3Country());
      }
   }
}