Java Programming Tutorials

Java programming tutorials with many code examples!

Java Util Currency getDisplayName Locale


The method java.util.Currency.getDisplayName(Locale) gets the name that is suitable for displaying this currency for the specified locale.

Method signature

The signature of the java.util.Currency.getDisplayName(Locale) method is as follows:

public String getDisplayName(Locale locale)

The method is available since Java 7.


  • Locale: the locale for which a display name for this currency is needed

Return value

Returns the display name of this currency for the specified locale.


  • NullPointerException: if locale is null

Example usage

In the following code we use java.util.Currency.getDisplayName(Locale):


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

public class CurrencyGetDisplayNameWithLocale {

    public static void main(String[] args) {
        Currency currency = Currency.getInstance(Locale.CHINA);

        System.out.println("Currency: " + currency);
        System.out.println("French display name: "
                + currency.getDisplayName(Locale.FRANCE));

        System.out.println("Korean display name: "
                + currency.getDisplayName(Locale.KOREA));

The above code produces the following output:

Currency: CNY
French display name: yuan renminbi chinois
Korean display name: 중국 위안 인민폐
Share with the World!