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   ww  w  .  ja v  a  2 s  . co  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.