Java Locale getISOCountries() method

The getISOCountries() method of Locale class returns a list of all 2-letter country codes defined in ISO 639. This method can be used to create Locales.

Syntax

Parameter

NA

Return Value

This method doesn't return any value.

Example 1

Output:

Locale: english_IN
Countries are:
0:AD
1:AE
2:AF
3:AG
4:AI
5:AL
6:AM
7:AO
8:AQ
9:AR
10:AS
11:AT
12:AU
13:AW
14:AX
15:AZ
16:BA
17:BB
18:BD
19:BE
20:BF
21:BG
22:BH
23:BI
24:BJ
25:BL
26:BM
27:BN
28:BO
29:BQ
30:BR
31:BS
32:BT
33:BV
34:BW
35:BY
36:BZ
37:CA
38:CC
39:CD
40:CF
41:CG
42:CH
43:CI
44:CK
45:CL
46:CM
47:CN
48:CO

Example 2

Output:

Locale: japanese_JA
Countries are:
0:aa
1:ab
2:ae
3:af
4:ak
5:am
6:an
7:ar
8:as