I am Java beginner, whats worng with this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am Java beginner, whats worng with this code?

public class Main { public static void Main(String[]args) { } } int x= 15; if (x>= 17 && x<=40){ System.out.println("Well done, u can work 4 us") }else{ System.out.println("Sorry brodi") }

19th Jun 2020, 5:02 PM
Alfredo Zayas
Alfredo Zayas - avatar
2 Answers
+ 1
Two errors that I can see: 1. There are two spurious closing braces on lines 5 and 6 (being line 1 "public class Main"). They should be at the very end of your code. 2. Both PrintLns are missing the trailing semicolon.
19th Jun 2020, 5:05 PM
Felipe BF
+ 2
it should be public static void main (not Main :P) Also you forgot semi colons at the end of print statements
19th Jun 2020, 5:04 PM
Seniru
Seniru - avatar