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 {



you are giving a pretty vague description.
does p have a value? what is lookUp's value?
if the equals without the ! gives "nothing", it means the values aren't identical.
try and printing out the values of aa and lookUp each time you check that. maybe that 'll give the answer.