Java Date Time - Java Calendar .getAvailableLocales ()








Syntax

Calendar.getAvailableLocales() has the following syntax.

public static Locale [] getAvailableLocales()

Example

In the following code shows how to use Calendar.getAvailableLocales() method.

//  w  w w  .  j  a v  a2 s  . c o m

import java.util.Locale;

public class Main {

   public static void main(String args[]) {

      // create an object of locale class 
      Locale[] array = Locale.getAvailableLocales();

      // print the results
      for (int i = 0; i < 10; i++) {
         System.out.println(array[i].getISO3Country());
      }
   }
}

The code above generates the following result.