fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Map<String,Locale> map = new HashMap<String, Locale>();
  13. for (Locale locale : Locale.getAvailableLocales()) {
  14. System.out.println(locale.getDisplayCountry() + " " + locale.getISO3Country());
  15. map.put(locale.getDisplayCountry(), locale);
  16. }
  17. }
  18. }
Runtime error #stdin #stdout #stderr 0.19s 321088KB
stdin
Standard input is empty
stdout
 
United Arab Emirates ARE
Jordan JOR
Syria SYR
Croatia HRV
Belgium BEL
Panama PAN
Malta MLT
Venezuela VEN
 
Taiwan TWN
 
 
 
 
Denmark DNK
Puerto Rico PRI
Vietnam VNM
United States USA
Montenegro MNE
Sweden SWE
Bolivia BOL
Singapore SGP
Bahrain BHR
 
Saudi Arabia SAU
 
Yemen YEM
India IND
 
Malta MLT
Finland FIN
 
 
 
Bosnia and Herzegovina BIH
 
Ukraine UKR
 
Switzerland CHE
 
Argentina ARG
Egypt EGY
Japan JPN
El Salvador SLV
Brazil BRA
 
Iceland ISL
Czech Republic CZE
 
Poland POL
 
Spain ESP
stderr
Exception in thread "main" java.util.MissingResourceException: Couldn't find 3-letter country code for CS
	at java.util.Locale.getISO3Country(Locale.java:1625)
	at Ideone.main(Main.java:14)