0
Why it prints the else statement if i give "hi" as input...?
2 Answers
+ 3
Use String.equals() when comparing String values. Below link describes the difference.
P.S. Put Java in post's tags for context clarity.
https://www.geeksforgeeks.org/difference-between-and-equals-method-in-java/
+ 1
Thank you:) Ipang