0

Problem with condition

Why is the condition in the code executed after else. In the console I write "help" (without paws), but the result is the one that after else. https://code.sololearn.com/cbYB3Lq0aEvV/?ref=app P.S. Sorry my english :D

27th Jun 2018, 8:46 AM
Š Š¾Š¼Š° ŠœŠ°Š»ŠµŠ½ŠŗŠ¾
Š Š¾Š¼Š° ŠœŠ°Š»ŠµŠ½ŠŗŠ¾ - avatar
2 Answers
+ 3
== will compare two references of the String object, not the contents of the String object to solve your condition use this: if ("help".equals(e)){ ā€”> compare the contents and you get ā€œhelloā€
27th Jun 2018, 8:55 AM
asa22