Why there are many curly brackets at the end? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why there are many curly brackets at the end?

public class FirstCode { public static void main(String args[]) { int age = 19; int money = 600; if (age > 18) { if (money > 500) { System.out.print("Welcome"); } } } } Usually there are not many curly brackets at my first code. But now the eclipse software showing errors. In order to fix this you need to put more curly brackets at the end. Why this happen?

5th May 2020, 3:07 PM
Ray
Ray - avatar
1 Antwort
+ 1
Every block that opens with an {, also needs a closing }. Most often, you just have forgotten one somewhere.
5th May 2020, 3:13 PM
HonFu
HonFu - avatar