Get available Currencies in Java
Description
The following code shows how to get available Currencies.
Example
//from w w w.j a v a 2 s .com
import java.util.Currency;
import java.util.Locale;
import java.util.Set;
public class Main {
public static void main(String[] args) {
Set<Currency> currencies = Currency.getAvailableCurrencies();
for (Currency currency : currencies) {
System.out.println("" + currency.getDisplayName() + " - "
+ currency.getDisplayName(Locale.GERMAN) + " - "
+ currency.getNumericCode());
}
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »