The java.util.Currency class represents a currency. These are the main properties of the class:
- Currencies are identified by their ISO 4217 currency codes
- There is never more than one Currency instance for any given currency
- Get instance of the class using getInstance() methods
- the class is final and cannot be inherited.
The class declaration is:
public final class Currency extends Object implements Serializable
Methods inheritance
Objects of this class inherit methods from the following classes:
- java.lang.Object
Methods of java.util.Currency:
- static Set<Currency> getAvailableCurrencies()
This method gets the set of available currencies. - String getCurrencyCode()
This method gets the ISO 4217 currency code of this currency. - int getDefaultFractionDigits()
This method gets the default number of fraction digits used with this currency. - String getDisplayName()
This method gets the name that is suitable for displaying this currency for the default DISPLAY locale. - String getDisplayName(Locale locale)
This method gets the name that is suitable for displaying this currency for the specified locale. - static Currency getInstance(Locale locale)
This method returns the Currency instance for the country of the given locale. - static Currency getInstance(String currencyCode)
This method returns the Currency instance for the given currency code. - int getNumericCode()
This method returns the ISO 4217 numeric code of this currency. - String getSymbol()
This method gets the symbol of this currency for the default DISPLAY locale. - String getSymbol(Locale locale)
This method gets the symbol of this currency for the specified locale. - String toString()
This method returns the ISO 4217 currency code of this currency.