Java Data Type Tutorial - Java Currency .getAvailableCurrencies ()








Syntax

Currency.getAvailableCurrencies() has the following syntax.

public static Set <Currency> getAvailableCurrencies()

Example

In the following code shows how to use Currency.getAvailableCurrencies() method.

// w w w  . jav a2  s  .co m
import java.util.Currency;
import java.util.Set;

public class Main {

   public static void main(String args[]) {
     Set<Currency> cSet =  Currency.getAvailableCurrencies();
     for(Currency c:cSet){
       System.out.println(c);
     }
   }
}

The code above generates the following result.