Java Currency Class: getAvailableCurrencies() Method
public static Set<Currency> getAvailableCurrencies()
The getAvailableCurrencies() method is used to get the set of available currencies.
The returned set of currencies contains all of the available currencies, which may include currencies that represent obsolete ISO 4217 codes. The set can be modified without affecting the available currencies in the runtime.
Package: java.util
Java Platform: Java SE 8
Syntax:
getAvailableCurrencies()Return Value:
the set of available currencies.If there is no currency available in the runtime, the returned set is empty.
Return Value Type: Set<Currency>
Example: Java Currency class: getAvailableCurrencies() Method
import java.util.Currency;
import java.util.Set;
public class Main {
public static void main(String args[]) {
Set c_set = Currency.getAvailableCurrencies();
System.out.println("Available currencies:");
for(Currency c:c_set){
System.out.println(c);
}
}
}
Output:
Available currencies: 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
Java Code Editor:
Previous:Currency Home
Next:getCurrencycode Method
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/java-tutorial/util/currency/java_currency_getavailablecurrencies.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics