title: Java object equals method not work
body: <p>I have trouble with my code, the equals method is not working, I have try both <code>==</code> and <code>.equals()</code> but it's not working.</p>
  
  <p>This is the code for main method:</p>
  
  <pre><code>x= new Card('♠',"number","3",5,Color.BLACK);
  y= new Card('♠',"number","3",5,Color.BLACK);
  if(x.equals(y)) System.out.println("True"); else System.out.println("False");
  </code></pre>
  
  <p>The program is printing "False" in the screen.</p>
  
  <p>this is my Card class :</p>
  
  <pre><code>package core;
  
  import java.awt.Color;
  
  public class Card {
      private char symbol;
      private String type,value;
      private int score;
      private Color warna;
      public Card(char symbol, String type, String value,int score,Color warna)
      {
          this.setSymbol(symbol);
          this.setValue(value);
          this.setType(type);
          this.setScore(score);
          this.warna = warna;
      }
      public char getSymbol() {
          return symbol;
      }
      public void setSymbol(char symbol) {
          this.symbol = symbol;
      }
      public String getValue() {
          return value;
      }
      public void setValue(String value) {
          this.value = value;
      }
      public String getType() {
          return type;
      }
      public void setType(String type) {
          this.type = type;
      }
      public int getScore() {
          return score;
      }
      public void setScore(int score) {
          this.score = score;
      }
      public Color getWarna() {
          return warna;
      }
      public void setWarna(Color warna) {
          this.warna = warna;
      }
  }
  </code></pre>
  
  <p>What should I do?</p>