Java Currency getAvailableCurrencies() Method

The getAvailableCurrencies() is a method of Java Currency class which is used to get the set of available currencies. It returns all the currencies which may include currencies that represent obsolete ISO 4217 codes.

Syntax

Following is the declaration of getAvailableCurrencies() method:

Parameter

DataTypeParameterDescription
Static SetNAIt returns all available currencies as a Set object

Returns

The getAvailableCurrencies() method returns the set of currencies. At the run time if there is no currency available, this will return the empty set.

Exceptions

NA

Compatibility Version

Java 1.7 and above

Example 1

Output:

Available currencies are:
ETB
CRC
CVE
TMT
ADP
GIP
COU
BGN
ZWL

Example 2

Output:

Total Number of available Currencies is: 224

Example 3

Output:

List of all currencies are:
ETB, CRC, CVE, TMT, ADP, GIP, COU, BGN, ZWL, HKD, DOP, QAR, BOB, XAU, HRK, THB, MYR, NIO, 
SKK, BND, UAH, CLP, CSD, SZL, GBP, PYG, UZS, ZMW, USD, RUR, INR, RWF, CHW, XCD, GMD, LAK, 
EEK, LRD, GHS, XPD, CUP, XBA, KYD, RSD, GWP, MOP, SGD, SBD, AOA, XOF, XXX, MDL, SRD, SAR, 
IQD, KMF, JPY, MXV, GNF, VUV, VEF, VND, LYD, FIM, GRD, OMR, AED, MGA, RON, ISK, EGP, MAD, 
MWK, WST, SCR, KPW, ZWR, LBP, ZWN, CDF, ARS, FJD, BSD, NPR, TOP, ZAR, MUR, SHP, JOD, CHF, 
CZK, SEK, SLL, JMD, USS, BGL, SDD, BRL, ITL, AYM, NOK, BHD, LUF, BMD, BTN, YER, LSL, ZMK, 
MGF, MZM, AUD, PEN, CNY, HNL, HTG, XPF, XFU, UYI, GEL, CYP, TND, ATS, GHC, EUR, PGK, UGX, 
TRY, SRG, SDG, XBD, LTL, KHR, UYU, CUC, MTL, COP, LKR, CHE, AWG, BAM, XAF, IDR, NZD, XBC, 
AZN, MZN, ANG, BYR, CAD, NLG, XFO, MKD, TPE, KWD, XBB, SIT, AMD, MMK, BWP, ALL, TTD, DKK, 
PLN, DEM, FRF, CLF, YUM, MXN, XUA, HUF, TWD, BDT, XDR, AZM, PTE, TMM, KZT, BBD, AFN, SYP, 
PAB, VEB, KRW, MRO, AFA, ERN, IEP, BYB, SVC, BEF, KES, SSP, XPT, TRL, XTS, ZWD, XAG, NGN, 
DZD, MNT, IRR, ESP, TJS, NAD, LVL, XSU, MVR, STD, RUB, DJF, PKR, PHP, BIF, TZS, ROL, GYD, 
ILS, SOS, BZD, GTQ, KGS, USN, BOV, FKP,

Example 4

Output:

Currency : ETB Name : Ethiopian Birr
Currency : CRC Name : Costa Rican Colón
Currency : CVE Name : Cape Verdean Escudo
Currency : TMT Name : Turkmenistani Manat
Currency : ADP Name : Andorran Peseta
Currency : GIP Name : Gibraltar Pound
Currency : COU Name : COU
Currency : BGN Name : Bulgarian Lev
Currency : ZWL Name : Zimbabwean Dollar (2009)
Currency : HKD Name : Hong Kong Dollar
Currency : DOP Name : Dominican Peso