DecimalFormatSymbols GetAvailableLocales() Example
Returns an array of all locales
DecimalFormatSymbolsclass GetAvailableLocales() method example. This example shows you how to use GetAvailableLocales() method.This method Returns an array of all locales for which the getInstance methods of this class can return localized instances.
Here is the code:-
/**
* @Program that Returns an array of all locales
* GetAvailableLocales.java
* Author:-RoseIndia Team
* Date:-14-Jun-2008
*/
import java.text.*;
import java.util.*;
public class GetAvailableLocales {
public static void main(String[] args) {
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
//Returns an array of all locales
Locale[] h = dfs.getAvailableLocales();
for (int i = 0; i < 15; i++) {
System.out.println(h[i]);
}
}
} |
Output of the Program
ja_JP
es_PE
en
ja_JP_JP
es_PA
sr_BA
mk
es_GT
ar_AE
no_NO
sq_AL
bg
ar_IQ
ar_YE
hu |
|