0
What is wrong with my java code?
try entering "Big Big Big" https://code.sololearn.com/cDvj21GrYWnj/?ref=app
4 Réponses
+ 5
s == "Big" will return false since it is generally used for reference checking.
Use s.equals("Big") inside the if statement to check for matching content and not reference.
+ 2
Use equals method from String class for comapring Strings instead of ==
+ 1
Note also the diferrence between lower and upper case.
"big".equals("Big") returns false.
"big".equalsIgnoreCase("Big") returns true.
+ 1
Thanks a lot.