Java Format - Java NumberFormat .getAvailableLocales ()


NumberFormat.getAvailableLocales() has the following syntax.

public static Locale [] getAvailableLocales()


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

//from  w  ww .ja  v  a2  s  . 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){

The code above generates the following result.