Java.util.Locale.getDisplayLanguage(Locale inLocale) 方法


Java.util.Locale.getDisplayLanguage(Locale inLocale) 方法

package com.codingdict;

import java.util.*;

public class LocaleDemo {
   public static void main(String[] args) {

      // create a new locale
      Locale locale = new Locale("ENGLISH", "US");

      // print locale
      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")));
   }
}