Java Locale .getDisplayLanguage ( Locale inLocale)

Syntax

Locale.getDisplayLanguage(Locale inLocale) has the following syntax.

public String getDisplayLanguage(Locale inLocale)

Example

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


/*www  .j a v a  2  s .  co  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 for another locale - result is based on inLocale
      System.out.println("Language:"
              + locale.getDisplayLanguage(new Locale("GERMANY", "GERMAN")));

   }
}

The code above generates the following result.