Get Currency Symbols for Locale.US in Java
Description
The following code shows how to get Currency Symbols for Locale.US.
Example
//from ww w .jav a 2s . c om
import java.util.Currency;
import java.util.Locale;
public class Main {
public static void main(String[] args) {
Currency currency = Currency.getInstance(Locale.US);
System.out.println("United States: " + currency.getSymbol());
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »