Java Currency.getDisplayName()

Syntax

Currency.getDisplayName() has the following syntax.

public String getDisplayName()

Example

In the following code shows how to use Currency.getDisplayName() method.


//from   www  .j a va2s  .  c o m

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

public class Main {

   public static void main(String args[]) {
      Locale locale = Locale.UK;
      Currency curr = Currency.getInstance(locale);

      System.out.println(curr.getDisplayName());
   }
}

The code above generates the following result.