getAvailableLocales() method Example

getAvailableLocales() method Example


Posted in : Java Posted on : November 23, 2011 at 6:42 PM Comments : [ 0 ]

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 :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics