Java Locale.getDisplayLanguage()

Syntax

Locale.getDisplayLanguage() has the following syntax.

public final String getDisplayLanguage()

Example

In the following code shows how to use Locale.getDisplayLanguage() method.


/* w ww.j av a 2  s .c o  m*/

import java.util.Locale;

public class Main {

   public static void main(String[] args) {
      Locale locale = new Locale("ENGLISH", "US");

      System.out.println("Locale:" + locale);

      // print language
      System.out.println("Language:" + locale.getDisplayLanguage());

   }
}

The code above generates the following result.