Locale.getAvailableLocales(): This method is available in java.util.Locale class of Java.
Syntax:
Locale[] java.util.Locale.getAvailableLocales()
This method returns an array of all installed locales. The returned array represents the union of locales supported by the Java runtime environment and by installed LocaleServiceProvider implementations. It must contain at least a Locale instance equal to Locale.US.
Returns: An array of installed locales.
Approach
Java
import java.util.Arrays;import java.util.Locale;public class LocalegetAvailableLocales {public static void main(String[] args) {System.out.println("There are " +Arrays.toString(Locale.getAvailableLocales()).length() +" Locales Available");}}
Output:
There are 5728 Locales Available
No comments:
Post a Comment