heres my code for a library application
package com.accenture.totalbeginner; public class Person { private String name; private int maximumbooks; pub
getMaximumbooks() returns a primitive type int not an Object. You have to compare it with == or in you case != (not equals)
getMaximumbooks()
int
Object
==
!=
equals
if (this.getMaximumbooks() != p1.getMaximumbooks()) { return false; } return true;