Java Data Type Tutorial - Java Currency .getDisplayName ( Locale locale)








Syntax

Currency.getDisplayName(Locale locale) has the following syntax.

public String getDisplayName(Locale locale)

Example

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

/*w ww  .j  a  v a  2s .  com*/
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(Locale.UK));
   }
}

The code above generates the following result.