Java NumberFormat .getAvailableLocales ()

Syntax

NumberFormat.getAvailableLocales() has the following syntax.

public static Locale [] getAvailableLocales()

Example

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


/*  w  w  w. ja  v  a 2s .c o  m*/
import java.text.NumberFormat;
import java.util.Locale;

public class Main {
  public static void main(String[] args) throws Exception {
    Locale[] locales = NumberFormat.getAvailableLocales();
    for(Locale locale: locales){
      System.out.println(locale.getDisplayCountry());
    }
  }
}




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat