範例, 參考如下 :
程式碼
Locale currentLocale = Locale.getDefault(); System.out.println( "currentLocale: " + currentLocale ); System.out.println( "DisplayName: " + currentLocale.getDisplayName() ); System.out.println( "Language: " + currentLocale.getLanguage() ); System.out.println( "DisplayLanguage: " + currentLocale.getDisplayLanguage() ); System.out.println( "Country: " + currentLocale.getCountry() ); System.out.println( "DisplayCountry: " + currentLocale.getDisplayCountry() );
範例結果, 如下 :