title: Check if two objects are completely equal in Java
body: <p>I've got a Java class, here's an example:</p>
  
  <pre><code>public class Car {
  
      private int fuelType;
      private Date made;
      private String name;
  .
  .
  . // and so on
  </code></pre>
  
  <p>Now let's say I have two car objects and I want to compare if all their variables are equal.</p>
  
  <p>Right now, I've solved this by overriding method <code>equals(Object o)</code> and I check if all the variables match in both objects.</p>
  
  <p>The problem here is that if I have 20 classes, I'll have to override <code>equals(Object o)</code> in every single one of them.</p>
  
  <p>Is there a way create some sort of universal method that could compare any of the two objects that I pass to it and let me know if they match in every single variable or not? </p>