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.


//from  w  w w  .ja v a2 s  . 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.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat