DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Fyodor has posted 14 posts at DZone. View Full User Profile

List Of Countries And ISO Codes Supported By The JVM.

04.09.2007
| 6683 views |
  • submit to reddit
        The following code displays country names and ISO-codes for the locales supported by the JVM.

        for (Locale locale : Locale.getAvailableLocales()) {
            final String contry = locale.getDisplayCountry();
            if (contry.length() > 0) {
                System.out.println("Country = " + contry + ". ISO code: " + locale.getISO3Country());
            }
        }