Open In App

Locale getAvailableLocales() Method in Java with Examples

Improve
Improve
Like Article
Like
Save
Share
Report

The getAvailableLocales() Method of Locale class in Java is used get the collection of arrays of all the installed locales by the Java Runtime Environment and the LocaleServiceProviders.

Syntax:

LOCALE.getAvailableLocales()

Parameters: This method does not take any parameters.

Return Value: This method returns the array collection of all the installed locales.

Below program illustrates the working of getAvailableLocales() method:




// Java code to illustrate equals() method
import java.util.*;
  
public class Locale_Demo {
    public static void main(String[] args)
    {
  
        // Creating a new locale
        Locale[] locale_list = Locale.getAvailableLocales();
  
        // Displaying all the locales
        System.out.println("Below is the list of all the locales"
                           + " installed on this System:\n");
  
        for (int i = 0; i < locale_list.length; i++)
            System.out.println(i + ":" + locale_list[i]);
    }
}


Output:

Below is the list of all the locales
0:
1:ar_AE
2:ar_JO
3:ar_SY
4:hr_HR
5:fr_BE
6:es_PA
7:mt_MT
8:es_VE
9:bg
10:zh_TW
11:it
12:ko
13:uk
14:lv
15:da_DK
16:es_PR
17:vi_VN
18:en_US
19:sr_ME
20:sv_SE
21:es_BO
22:en_SG
23:ar_BH
24:pt
25:ar_SA
26:sk
27:ar_YE
28:hi_IN
29:ga
30:en_MT
31:fi_FI
32:et
33:sv
34:cs
35:sr_BA_#Latn
36:el
37:uk_UA
38:hu
39:fr_CH
40:in
41:es_AR
42:ar_EG
43:ja_JP_JP_#u-ca-japanese
44:es_SV
45:pt_BR
46:be
47:is_IS
48:cs_CZ
49:es
50:pl_PL
51:tr
52:ca_ES
53:sr_CS
54:ms_MY
55:hr
56:lt
57:es_ES
58:es_CO
59:bg_BG
60:sq
61:fr
62:ja
63:sr_BA
64:is
65:es_PY
66:de
67:es_EC
68:es_US
69:ar_SD
70:en
71:ro_RO
72:en_PH
73:ca
74:ar_TN
75:sr_ME_#Latn
76:es_GT
77:sl
78:ko_KR
79:el_CY
80:es_MX
81:ru_RU
82:es_HN
83:zh_HK
84:no_NO_NY
85:hu_HU
86:th_TH
87:ar_IQ
88:es_CL
89:fi
90:ar_MA
91:ga_IE
92:mk
93:tr_TR
94:et_EE
95:ar_QA
96:sr__#Latn
97:pt_PT
98:fr_LU
99:ar_OM
100:th
101:sq_AL
102:es_DO
103:es_CU
104:ar
105:ru
106:en_NZ
107:sr_RS
108:de_CH
109:es_UY
110:ms
111:el_GR
112:iw_IL
113:en_ZA
114:th_TH_TH_#u-nu-thai
115:hi
116:fr_FR
117:de_AT
118:nl
119:no_NO
120:en_AU
121:vi
122:nl_NL
123:fr_CA
124:lv_LV
125:de_LU
126:es_CR
127:ar_KW
128:sr
129:ar_LY
130:mt
131:it_CH
132:da
133:de_DE
134:ar_DZ
135:sk_SK
136:lt_LT
137:it_IT
138:en_IE
139:zh_SG
140:ro
141:en_CA
142:nl_BE
143:no
144:pl
145:zh_CN
146:ja_JP
147:de_GR
148:sr_RS_#Latn
149:iw
150:en_IN
151:ar_LB
152:es_NI
153:zh
154:mk_MK
155:be_BY
156:sl_SI
157:es_PE
158:in_ID
159:en_GB

Last Updated : 27 Dec, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads