Locale.getDisplayLanguage(Locale inLocale) has the following syntax.
public String getDisplayLanguage(Locale inLocale)
In the following code shows how to use Locale.getDisplayLanguage(Locale inLocale) method.
/*www . j ava 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 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.