+ 2
I have a question about some java code please
Every time I run my program, and enter "Dustin" as the password, it keeps sending me to my else statement and not to my welcome() method. I have it printing variable a, and b. Which is the input from user, and the password drawn from a multidimensional array. They both match, so I used: if(a == b) { welcome(); } else { System.out.println("Wrong password"); }
4 Answers
+ 18
â use (a.equals(b)) in if() condition đ
â .equals() Method is used for content comparision , on the other hand == Operator is used for reference comparision.
+ 14
Sekiro
Probabaly he is having doubt in this code :
https://code.sololearn.com/cq0uzM0u5GeJ/?ref=app
Dustin James Locey
u can link the code for making your question more clear to community & get community help đ
+ 4
I'm sorry. I forgot to link it. But I got it working. Thank you :)
+ 3
Could you show the part of the code where you take input and the array, because like this is hard to say..