A RetroSearch Logo

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

Search Query:

Showing content from https://www.w3resource.com/java-tutorial/util/currency/java_currency_getcurrencycode.php below:

Website Navigation


Java Currency Class: getCurrencyCode() Method

Java Currency Class: getCurrencyCode() MethodLast update on November 18 2023 11:04:51 (UTC/GMT +8 hours) public String getCurrencyCode()

The getCurrencyCode() method is used to get the ISO 4217 currency code of a given currency.

Package: java.util

Java Platform: Java SE 8

Syntax:

getCurrencyCode()
Return Value:

The ISO 4217 currency code of this currency.

Return Value Type: String

Example: Java Currency class - getCurrencyCode() Method

The following example fills a Java Currency class: getCurrencyCode() Method

import java.util.*;
public class Main {
   public static void main(String args[]) {

      // create a currency with ETB code (ethiopian)
      Currency curr = Currency.getInstance("ETB");

      // Gets the ISO 4217 currency code and print it
      String cur_Code = curr.getCurrencyCode();
      System.out.println("Currency Code is = " + cur_Code);
   }
}

Output:

Currency Code is = ETB

Java Code Editor:

Previous:getAvailablecurrencies Method
Next:getDefaultfractiondigits Method




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