public class LocaleExam {
    public static void main(String[] args) {
        Locale locale=new Locale("de","CH");
        System.out.println("德文地区的ISO语言代码:"+locale.getLanguage());
        System.out.println("德文中的德文:"+locale.getLanguage());
        System.out.println("德文(瑞士)的Locale对象按操作系统的"+"默认本地方式显示的名称为:"+locale.getDisplayName());
        System.out.println("德文(瑞士)的Locale对象按德文:"+locale.getDisplayName());
        System.out.println("德文(瑞士)的locale对象按德文(瑞士)的"+"本地方式显示的信息为:"+locale.getDisplayName(locale));
        
        
        
    }

}

运行结果是:

德文地区的ISO语言代码:de
德文中的德文:de
德文(瑞士)的Locale对象按操作系统的默认本地方式显示的名称为:德文 (瑞士)
德文(瑞士)的Locale对象按德文:德文 (瑞士)
德文(瑞士)的locale对象按德文(瑞士)的本地方式显示的信息为:Deutsch (Schweiz)

相关文章:

  • 2021-04-15
  • 2021-08-27
  • 2022-12-23
  • 2022-02-21
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-09-18
相关资源
相似解决方案