Using the Currency class in Java 7 - Java Internationalization

Java examples for Internationalization:Currency

Description

Using the Currency class in Java 7

Demo Code

import java.util.Currency;
import java.util.Locale;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Set<Currency> currencies = Currency.getAvailableCurrencies();
        for (Currency currency : currencies) {
            System.out.println("" + currency.getDisplayName()
                    + " - " + currency.getDisplayName(Locale.GERMAN)                  
                    + " - " + currency.getNumericCode());
        }//from w w  w  .  ja  v  a2s  .c om

    }
}

Related Tutorials