Java DateFormat.equals(Object obj)

Syntax

DateFormat.equals(Object obj) has the following syntax.

public boolean equals(Object obj)

Example

In the following code shows how to use DateFormat.equals(Object obj) method.


import java.text.DateFormat;
/*from   w w w  . j av a 2s  . c  o  m*/
public class Main {
  public static void main(String args[])  {
    DateFormat df1 = DateFormat.getDateInstance();
    DateFormat df2 = DateFormat.getTimeInstance();
    System.out.println(df1.equals(df2));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat