Override the toString method and the equals method.