Java.util.Locale.getISOLanguages() 方法


Java.util.Locale.getISOLanguages() 方法

package com.codingdict;

import java.util.*;

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

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

      // print locale
      System.out.println("Locale:" + locale);

      // get ISO languages
      String[] languages = Locale.getISOLanguages();

      // print countries
      System.out.println("Languages are:");

      for (int i = 0; i < languages.length; i++) {
         System.out.println(i + ":" + languages[i]);
      }
   }
}