A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/java/util/java_util_currency.htm below:

Java Currency Class

Java Currency Class Introduction

The Java Currency class represents a currency. Following are the important points about Currency −

Class declaration

Following is the declaration for java.util.Currency class −

public final class Currency
   extends Object
   implements Serializable
Class methods Methods inherited

This class inherits methods from the following classes −

Getting All Available Currency Codes Example

The following example shows the usage of Java Currency getAvailableCurrencies() method to get a set of available currencies. We've created a set of avaiable currencies using getAvailableCurrencies() method and then printed each currency code.

package com.tutorialspoint;

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

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

      Set<Currency> currencies = Currency.getAvailableCurrencies();

      System.out.println("Available Currencies: ");
      currencies.forEach(c -> System.out.print(c.getCurrencyCode() + " "));
   }
}

Let us compile and run the above program, this will produce the following result −

Available Currencies: 
SDG CNY TJS TMM IRR RWF KMF ZWR BYN BRL SYP SSP XTS BOV IQD TPE THB TND BND UYI LKR MGF MMK CHW MNT HKD ZMK SRD SKK CUP MYR SGD RUR SCR VES XPF RSD XCD XAU XOF WST DOP NIO LRD DJF TOP KPW GEL XFO MWK JPY KYD MKD XAG YER CRC XDR PLN RON KRW ANG RUB AED ESP XBA TWD ZAR TZS MUR HUF AZN MGA SBD XPT MTL UAH AOA TTD CVE HNL GBP BIF EEK SRG IDR MDL BGL NLG CHF FJD MOP LVL CLP HTG SIT KWD XUA AYM BYR FRF XXX PYG MXV MRO BDT COU SOS GNF ZWN VEF ATS BSD UZS BZD NPR IEP PAB DEM GMD UYU UGX CZK CDF LBP ALL PKR BTN XBD ETB DZD KGS STD LAK AUD QAR VND BHD JMD KHR SEK MZM SVC PHP USS TRL XAF SAR CYP BWP BGN CSD AFA MAD LTL TRY VUV SLL ARS PEN MVR GWP PTE ILS BYB CLF XPD AWG LYD ROL VEB MXN AMD OMR GIP CAD GHS FIM ZWD KZT JOD HRK DKK PGK YUM CUC LSL NGN ZWL AFN ZMW EGP NZD COP AZM BMD GHC GRD NAD BEF XSU TMT MRU XBB BAM CHE SDD BBD EUR NOK SHP SZL BOB LUF GTQ KES FKP ADP USN ISK MZN INR STN ITL XFU GYD ERN USD XBC 

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4