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_toString.php below:

Website Navigation


Java Currency Class: toString() Method

Java Currency Class: toString() MethodLast update on August 19 2022 21:50:42 (UTC/GMT +8 hours) public String toString()

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

Package: java.util

Java Platform: Java SE 8

Syntax:

toString()
Return Value:

the ISO 4217 currency code of this currency

Return Value Type: String

Example: Java Currency class: toString() Method

The following example fills aJava Currency class: toString() Method

import java.util.*;

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

    // Create a currency with specific currency code
      Currency curr = Currency.getInstance("YER");

    // Get the currency string and display it
      System.out.println("String representation: " + curr.toString());
   }
}

Output:

String representation: YER

Java Code Editor:

Previous:getSymbol Method
Next:Java String Methods




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