Java Currency getCurrencyCode Example


Currency class getCurrencyCode method example. This example shows you how to use getCurrencyCode method. .
Syntax is : public String getCurrencyCode() . Method returns the ISO 4217 currency code of specified currency.

Here is the code.

/**
 * @(#) GetCurrencyCodeCurrency.java
 * A class representing use of method getCurrencyCode() of Currency class
 in java.util Package.
 * @Version  21-May-2008
 @author   Rose India Team
 */
import java.util.*;

class GetCurrencyCodeCurrency {
    public static void mainString args[] ){
    /* There is no default constructor available so use getInstance() method
  to create object of Currency object. */
    Currency curr = Currency.getInstance("INR");
  // For more currency code visit http://www.currencysystem.com/codes
    String curCode = curr.getCurrencyCode();
    System.out.println"Currency Code is = " + curCode);
  }
}

Output of the program.
Currency Code is = INR

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US