Java Currency.getCurrencyCode() Method

 Posted On  | Yashwant Chavan 

In this tutorial, You will learn about Java Currency.getCurrencyCode() Method. Which returns the ISO 4217 currency code of this currency.


Gets the ISO 4217 currency code of this currency.

String java.util.Currency.getCurrencyCode()


return the ISO 4217 currency code of this currency.

Java Currency.getCurrencyCode() example

Refer below steps

  • Create Currency instance using Currency.getInstance(Locale locale) method.
  • Print currency code using Currency.getCurrencyCode() method.

import java.util.Currency;
import java.util.Locale;

public class JavaCurrencyGetCurrencyCode {

    public static void main(String[] args) {

        Currency us = Currency.getInstance(Locale.US);
        System.out.println("Currency code US:- " + us.getCurrencyCode());

        Currency uk = Currency.getInstance(Locale.UK);
        System.out.println("Currency code UK:- " + uk.getCurrencyCode());



Currency code US:- USD
Currency code UK:- GBP

Promote your Blog, Website, or services on, My paypal id:

Payment will be accepted through paypal only.

© 2017

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0344 seconds.