Java Format - 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.

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