title: Compare objects android
body: <p>I'm writing an app and at some point I have to compare two arraylist or two objects, I defined a class called Article and wrote this code to compare two articles</p>
  
  <pre><code>    public boolean aredifferent(){
  
      Article art1 = new Article();
      art1.setBm(null);
      art1.setDesc("he");
      art1.setImagelink("www");
      art1.setLink("www");
      art1.setTitle("ti");
  
      Article art2 = new Article();
      art2.setBm(null);
      art2.setDesc("he");
      art2.setImagelink("www");
      art2.setLink("www");
      art2.setTitle("ti");
      boolean diff;
      if(art1.equals(art2)){
          diff = false;
      }else{
          diff = true;
      }
  
  
      return diff;
  
  }
  </code></pre>
  
  <p>the problem I'm having that this method is returning true and I can't see why. any ideas? is there a different way to compare objects in android? </p>
  
  <p>Thank you</p>