fork(1) download
  1. import java.text.DateFormat;
  2. import java.text.SimpleDateFormat;
  3.  
  4. class Example
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. DateFormat a = new SimpleDateFormat("yyyy-MM-dd");
  9. DateFormat b = new SimpleDateFormat("yyyy-MM-dd");
  10. System.out.println(a == b ? "== Same" : "== Different");
  11. System.out.println(a.equals(b) ? "equals Same" : "equals Different");
  12. }
  13. }
Success #stdin #stdout 0.08s 4386816KB
stdin
Standard input is empty
stdout
== Different
equals Same