Java Format - Java DecimalFormat.clone()








Syntax

DecimalFormat.clone() has the following syntax.

public Object clone()

Example

In the following code shows how to use DecimalFormat.clone() method.

/* w w w  .j av a2s.  c o  m*/
import java.text.DecimalFormat;
import java.util.Currency;
import java.util.Locale;

public class Main {
  public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();
    format.setCurrency(Currency.getInstance(Locale.GERMANY));
    System.out.println(format.clone());

  }
}

The code above generates the following result.