Java.util.Currency.getSymbol() 方法示例


Java.util.Currency.getSymbol() 方法示例

package com.codingdict;

import java.util.*;

public class CurrencyDemo {
   public static void main(String args[]) {

      // create a currency for uk locale
      Locale locale = Locale.UK;
      Currency curr = Currency.getInstance(locale);

      // get and print the symbol of the currency
      String symbol = curr.getSymbol(locale);
      System.out.println("Currency symbol is = " + symbol);
   }
}