Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Currency class

187 views

Published on

introduction to currency class

Published in: Economy & Finance, Technology
  • Be the first to comment

  • Be the first to like this

Currency class

  1. 1. Java.util package
  2. 2. Currency
  3. 3. Currency class ● The java.util.Currency class represents a currency. ● Currencies are identified by their ISO 4217 currency codes. ● The class is designed so that there's never more than one Currency instance for any given currency. ● This is the reason behind no public constructor.
  4. 4. Methods in Currency Methods Description String getCurrencyCode() This method gets the ISO 4217 currency code Int getDefaultFractionDigits() This method gets the default number fo fraction digits used with the currency Static Currency getInstance(Locale locale) This method returns the Currency instance fof the country of the given locale Static Currency getInstance(String currencyCode) This method returns the currency instance for the given currency code String getSymbol() This method gets the symbol of this currency for the default locale. String getSymbol(Locale locale) This method gets the symbol of this currency for the default locale. String toString() This method reutrns the ISO 4217 currency code of this currency
  5. 5. Example program for Currency class
  6. 6. output

×