Why this though, ?! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why this though, ?!

I don't get it why is it printing not unlocked although the condition is true? https://code.sololearn.com/c50qJ2hz01U2/?ref=app

30th Oct 2022, 3:50 PM
Kaushik
Kaushik - avatar
1 Answer
+ 6
Use equals() method for string comparisons... It compares content. While : == compares references if (actual_password.equals(password)){
30th Oct 2022, 3:53 PM
Jayakrishna 🇮🇳