getDisplayName() method example

getDisplayName() method example


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

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

getDisplayName() method example

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

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

syntax :

public final String getDisplayName();

Example :

package devmanuals.com;
import java.util.Locale;
public class GetDisplayName
{
public static void main(String args[])
{
Locale loc[]= Locale.getAvailableLocales();
System.out.println("Language (Variant) : \n");
for(int i=0; i<loc.length; i++)
{
System.out.println(loc[i].getDisplayName());
}
}
}

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