getDisplayLanguage() method example

getDisplayLanguage() method example


Posted in : Java Posted on : November 23, 2011 at 7:00 PM Comments : [ 0 ]

In this tutorial you will learn how to use getDisplayLanguage() method in java.

getDisplayLanguage() method example

In this tutorial you will learn how to use getDisplayLanguage() method in java.

getDisplayLanguage() is a method of Locale class that returns the locale's language name.

syntax :

public final String getDisplayLanguage();

Example :

package devmanuals.com;
import java.util.Locale;

public class GetDisplayLanguage
{
public static void main(String[] args)
{
Locale[] locales = { Locale.US, Locale.KOREA, Locale.GERMANY, Locale.FRANCE };

System.out.println("Names of countries and language in use :\n");
System.out.println("Country \tLanguage ");
for (int i = 1; i <= locales.length; i++)
{
System.out.println(i+"."+locales[i-1].getDisplayCountry()+"\t"+locales[i-1].getDisplayLanguage());
}
}
}

Output :

When you will execute the above 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