Collator GetAvailableLocales() Example
Returns an array of all locales for which the getInstance methods of this class can return localized instances.
Collatorclass 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 for which the getInstance
methods of this class can return localized instances.
* GetAvailableLocales.java
* Author:-RoseIndia Team
* Date:-16-Jun-2008
*/
import java.util.*;
import java.text.*;
public class GetAvailableLocales {
public static void main(String[] args) {
Collator collate = Collator.getInstance();
Locale l[] = collate.getAvailableLocales();
System.out.println("Locales for which the getInstance methods can return localized instances ");
for (int i = 0; i < 15; i++) {
System.out.println(l[i]);
}
}
} |
Output of the program:-
Locales for which the getInstance methods can return localized instances
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
|
|