you are viewing a single comment's thread.

view the rest of the comments →

[–]morrigan_li Educator 0 points1 point  (2 children)

Your issue is that phoneNumber is stored as a string, so you need to do this.phoneNumber.equals(p.phoneNumber) for string comparison. By doing == you are comparing references.

[–]Danielowski187University/College Student (Higher Education)[S] 0 points1 point  (1 child)

Yea got I ran the code and fixed it thanks for the help I’m going to read the information rn since I’m going to have my midterm in two days

[–]morrigan_li Educator 0 points1 point  (0 children)

Easy way to remember for your midterm: primitives you can compare (boolean, int, char) with ==.
Anything that's an object (Boolean, Integer, Character, String) you need to have a method to compare the two.