Java Programming Tutorials

Java programming tutorials with many code examples!

Java Time Clock system(ZoneId)

java.time.Clock.system(ZoneId zone)

The method java.time.Clock.system(ZoneId zone) a clock that uses the best available system clock in the specified zone – never null.

Read More

Share with the World!

Java time Clock fixed

java.time.Clock.fixed()

The method java.time.Clock.fixed() returns a clock that always returns the same time. This type of clock is mainly useful in testing.

Read More

Share with the World!

Java Util Currency Tutorial

The java.util.Currency class represents a currency. These are the main properties of the class:

  • Currencies are identified by their ISO 4217 currency codes
  • There is never more than one Currency instance for any given currency
  • Get instance of the class using getInstance() methods
  • the class is final and cannot be inherited.

The class declaration is:

public final class Currency
       extends Object
       implements Serializable

Methods inheritance

Objects of this class inherit methods from the following classes:

  • java.lang.Object

Methods of java.util.Currency:

Share with the World!

Java Util Currency toString

java.util.Currency.toString()

The method java.util.Currency.toString() overrides Object.toString() and returns the ISO 4217 currency code of this currency.

Read More

Share with the World!

Java Util Currency getSymbol

java.util.Currency.getSymbol()

The method java.util.Currency.getSymbol() gets the symbol of this currency for the default DISPLAY locale or ISO 4217 currency code.

Read More

Share with the World!

Java Util Currency getNumericCode

java.util.Currency.getNumericCode()

Currencies are identified by their ISO 4217 currency codes. The method java.util.Currency.getNumericCode() returns the ISO 4217 numeric code of this currency.

Read More

Share with the World!