I have person class with id , first name and last name I have get and set methods
in main I wrote this
when I try to search for something in array list I always use .equal when I tried .equal without the ! it give me nothing , but when I added the ! it worked
I'm suprised can some one explain why it work this way is there soemthing wrong wiht my .equal
String lookUp = txtLook.getText();
String aa = null;
for (Person p : myList) {
aa = p.getlName();
if (!aa.equals(lookUp)) {
txtOutput.append(p + "");
} else {
txtOutput.append("nothing");
}
}