0
when do I need to put in curly brackets?
3 Réponses
+ 5
When there is more then one statement in the if-else. You can skip the { } when there is just one statement, but it is recommended to always put the brackets. It makes the code more readable.
+ 1
You put in curly brackets every time you start a new method and you close every time you end the method. The same applies when you start and end a class, a loop, a condition. Curly brackets are how you know that the code separated.
0
it is the seperator for that particular sequence