Why the Boolean operation result false? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Why the Boolean operation result false?

I use regex split method and use the result to match the word but the result always false even it's the same word https://code.sololearn.com/c2Ji7Fj4t9K5/?ref=app

1st Dec 2021, 12:14 PM
johannes lumbantoruan
johannes lumbantoruan - avatar
1 Réponse
+ 1
To compare a string u should use String.equals(String) ; from your Code System.out.println(word[0].equals( "Java"));
1st Dec 2021, 12:59 PM
Pariket Thakur
Pariket Thakur - avatar