Forum Discussion
Hello,
So, start understand this with very easy example.
Let's imagine that you have a toybox, and you want to know if your favorite car inside or not.
In Groovy, it's like asking the computer, "Hey, does my toybox contains car?"
You'd use a special trick called an "if statement" that looks like this:
if (toybox.contains('Car')){//do something}.
It's simply means - "If car is in there, then do a specific thing." So, if car is there, the computer follow the instructions which you are provide in inside {} curly brackets and if car isn't there, in that case it skips that part.
In very simple words, "You're just telling the computer to check if your favorite car ( Any toy ) in the box and if it is not there then tell the system ( Computer ) what to do next.
I hope this will help you.
Regards
soniya-01
Related Content
- 2 years ago
- 4 years ago
- 2 years ago
- 7 years ago
Recent Discussions
- 18 hours ago
- 17 days ago