If-Else Tutorial (Java)

Oct 23, 2020 16:19 · 174 words · 1 minute read let run short doubt else

What’s up guys, today I will teach you about the if-else statement So, let’s make an example You have just got in this amusement park, and you want to try a game, this new game So, you got in and you find a man at the opening doors And he is asking you for your height Because to get in that amusement park you need to be of a certain height So let’s make a variable you call it double height Which is equal, 1.70 cm (5.5 feet), oh sorry If height is less or equal than 1.65 cm (5.3 feet) Display You’re too short. Else, make it a little bigger, ok Else, display… Welcome! So, save and run this And we receive “Welcome!”, because the height is more than this (1.65 cm) But, if we put something like, say, 1.30 cm (4.

2 feet) 02:03 - “You’re too short” So, this was the if-else statement, I hope you understood the video If you have any question or doubt, leave it in the comment.