Java Currency.getCurrencyCode()
Syntax
Currency.getCurrencyCode() has the following syntax.
public String getCurrencyCode()
Example
In the following code shows how to use Currency.getCurrencyCode() method.
/* w w w . j a v a 2 s . c om*/
import java.util.Currency;
public class Main {
public static void main(String args[]) {
// create a currency with eur code
Currency curr = Currency.getInstance("EUR");
// get currency code and print it
String curCode = curr.getCurrencyCode();
System.out.println("Currency Code is = " + curCode);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.util »
Java Tutorial »
java.util »