Java NumberFormat.getCurrency()

Syntax

NumberFormat.getCurrency() has the following syntax.

public Currency getCurrency()

Example

In the following code shows how to use NumberFormat.getCurrency() method.


/*w  w  w  .j a v a 2s . c  o m*/
import java.text.NumberFormat;

public class Main {
  public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getInstance();
    System.out.println(numberFormat.getCurrency().getDisplayName());
  }
}




















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat