📅  最后修改于: 2020-11-14 06:14:31             🧑  作者: Mango
java.util.Currency类表示一种货币。以下是有关Currency的要点-
货币由其ISO 4217货币代码标识。
该类的设计使任何给定货币都不会有多个Currency实例,这就是没有公共构造函数的原因。
以下是java.util.Currency类的声明-
public final class Currency
extends Object
implements Serializable
Sr.No. | Method & Description |
---|---|
1 | String getCurrencyCode()
This method gets the ISO 4217 currency code of this currency. |
2 | int getDefaultFractionDigits()
This method gets the default number of fraction digits used with this currency. |
3 | static Currency getInstance(Locale locale)
This method returns the Currency instance for the country of the given locale. |
4 | static Currency getInstance(String currencyCode)
This method returns the Currency instance for the given currency code. |
5 | String getSymbol()
This method gets the symbol of this currency for the default locale. |
6 | String getSymbol(Locale locale)
This method gets the symbol of this currency for the specified locale. |
7 | String toString()
This method returns the ISO 4217 currency code of this currency. |
此类从以下类继承方法-