Java DateFormat.clone()

Syntax

DateFormat.clone() has the following syntax.

public Object clone()

Example

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


import java.text.DateFormat;
/*from   w ww. ja va 2  s .co m*/
public class Main {
  public static void main(String args[])  {
    DateFormat df1 = DateFormat.getDateInstance();

    System.out.println(df1.clone().equals(df1));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat