0

What is wrong with my code

public static void main(String[] args) { int age = 25; if (age>0){ if (age>19){ System .out.println ("Allowed"); }else{ System.out.println ("Deny"); }else{ System .out.println ("Error!"); }

21st Jan 2019, 12:28 PM
Shaps
Shaps - avatar
5 Answers
+ 2
You should indent your code properly, it will be easier to debug that way. public class Program { public static void main(String[] args) { int age = 25; if (age>0){ if (age>19){ System .out.println ("Allowed"); }else{ System.out.println ("Deny"); } }else{ System .out.println ("Error!"); } } } https://code.sololearn.com/c7mJg46Gx1Oe/#java
21st Jan 2019, 12:54 PM
Zen
Zen - avatar
0
Am i supposed to type my errors? Or how do i go about it
21st Jan 2019, 12:40 PM
Shaps
Shaps - avatar
0
Omg... Thank you so much for your help... It Worked!!!!! 🙂
21st Jan 2019, 12:56 PM
Shaps
Shaps - avatar