i have created an assertion line as below
String title = "A"; int year = 2009; String director = "Zebra"; VideoObj a = new VideoObj(title, year, director);
Assert.assertFalse(a.equals(new VideoObj(title+"1", year,director))); why does this fail?? the equal method is below.
public boolean equals(Object thatObject) { if (!(thatObject instanceof VideoObj)) return false; VideoObj that = (VideoObj) thatObject; return ((_title.equals(that.title())) && (_director.equals(that.director())) && (_year == that.year())); } but the below statement
Assert.assertFalse(a.equals(new VideoObj(title, year, director + "1"))); does not fail? can some one explain why the first assert statement fail and not the second?
equalsmethod is very wrong.&&? And why is the year not germane to equivalence?