fork(2) download
  1. class Example1
  2. {
  3. private int content;
  4.  
  5. Example1(int content) {
  6. this.content = content;
  7. }
  8.  
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. Example1 a = new Example1(42);
  12. Example1 b = new Example1(42);
  13. System.out.println(a == b ? "== Same" : "== Different");
  14. System.out.println(a.equals(b) ? "equals Same" : "equals Different");
  15. }
  16. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
== Different
equals Different