In this tutorial you will learn how to use getAvailableLocales() method in java.
getAvailableLocales() method Example
In this tutorial you will learn how to use getAvailableLocales() method in java.
getAvailableLocales() is a static method of Locale class that displays the list of installed locales.
syntax :
public static Locale[] getAvailableLocales();
Example :
AvailableLocales.java
package devmanuals.com; import java.util.Locale; import java.text.*; public class AvailableLocales { static public void main(String arr[]) { Locale loc[] = SimpleDateFormat.getAvailableLocales(); System.out.println("Available locales are :"); for (int i = 0; i< loc.length; i++) { System.out.println("\t"+loc[i]); } } }
Output :
When you will execute this example you will get the output as :
[ 0 ] Comments