+ 1

Izzy the Iguana Challenge

I decided to go back to this challenge and try to solve it in Java after I solved it in Python. Here’s my attempt: https://code.sololearn.com/cyOVdSY79gja/?ref=app For some reason, the variable “points” stays at 0, so the output is always “Time to wait”. Why?

9th Jan 2021, 6:11 AM
McInventor29
McInventor29 - avatar
2 odpowiedzi
+ 4
McInventor29 In java == compares object not value so you need to use equals method like food.equals("Mango")
9th Jan 2021, 6:23 AM
A͢J
A͢J - avatar
+ 2
I Am AJ ! It worked! Thank you!
9th Jan 2021, 12:01 PM
McInventor29
McInventor29 - avatar