Java SimpleDateFormat .equals (Object obj)

Syntax

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

public boolean equals(Object obj)

Example

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


//from   w  w w  . j av  a 2  s  .c  o m
import java.text.SimpleDateFormat;

public class Main {
  public static void main(String[] argv) throws Exception {

    SimpleDateFormat formatter = new SimpleDateFormat();
    formatter.applyPattern("MMM");
    
    System.out.println(formatter.equals(new SimpleDateFormat()));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.text »




DateFormat
DecimalFormat
NumberFormat
SimpleDateFormat