switch(menuChoice) {
case 1:
System.out.println(\"Enter your contact\'s first name:\\n\");
String fname = scnr.next();
System.out.println(\"Enter your cont
You should Override equals inside your Person class
public boolean equals(Object obj) {
if(fName.equals(obj.getfName()) && lName.equals(obj.getlName)) {
return true;
}
return false;
}
Then just call:
if(!(person1.equals(person2))) {
//not a duplicate
}
And of course substitute the variables/objects with whatever objects you want. You also should add getters and setters for last and first name. Hope this helps!