Java Data Type Tutorial - Java Currency.getNumericCode()








Syntax

Currency.getNumericCode() has the following syntax.

public int getNumericCode()

Example

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

/*from   w w w  .  ja va  2s.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.getCurrencyCode());
   }
}

The code above generates the following result.