Javatpoint Logo
Javatpoint Logo

Java Calendar getAvailableLocales() Method

The getAvailableLocals() method of java.util.Calendar class returns an array of all locales available in java runtime environment. The array of locales contains locales for which localized Calendar instances are available. getAvailableLocals() method is a static method.

Syntax

Parameter

This method doesn't accept any parameter.

Returns

This method returns all available locales in java Runtime Environment in the form of an array.

Throws

This method doesn't throw any exception.

Example 1

Test it Now

Output:

The first 5 locales installed in runtime environment are :-
ARE
JOR
SYR
HRV
BEL

Example 2

Test it Now

Output:

The first 5 locales installed in runtime environment are :-
ar_AE
ar_JO
ar_SY
hr_HR
fr_BE

Example 3

Test it Now

Output:

ar_AE
ar_JO
ar_SY
hr_HR
fr_BE
es_PA
mt_MT
es_VE
bg
zh_TW
it
ko
uk
lv
da_DK
es_PR
vi_VN
en_US
//all other available locales on java runtime environment will also be printed as output



Please Share

facebook twitter google plus pinterest