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.  j  a  va 2 s .  c  o  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.