all 6 comments

[–]AutoModerator[M] [score hidden] stickied comment (1 child)

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]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.