public class Hello World { public static void main(String [ ] args ) } { System.out.println ("Hello World"); | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

public class Hello World { public static void main(String [ ] args ) } { System.out.println ("Hello World");

what is the error in this code

21st Jan 2018, 5:15 PM
PRASHANT Mishra
PRASHANT Mishra - avatar
6 Answers
+ 28
so many errors 1)there must be no gap in class name 2)where is the opening & closing bracket of main method 3)print statement is out of main method & main method is out of bracket of class bracket //corrected code 👇 public class Hello_World { public static void main(String [ ] args ){ System.out.println ("Hello World"); } }
21st Jan 2018, 5:17 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
public class HelloWorld{ public static void main(String [] args ){ System.out.println("Hello World"); } } Like the other guys said no gaps in the class and put your system.out.println inside of the main method.
21st Jan 2018, 5:28 PM
Paul Yan
Paul Yan - avatar
+ 2
can explain in normal way because I am a amateur
21st Jan 2018, 5:24 PM
PRASHANT Mishra
PRASHANT Mishra - avatar
+ 1
can you tell me
21st Jan 2018, 5:18 PM
PRASHANT Mishra
PRASHANT Mishra - avatar
0
Hello world Hello java
12th Dec 2023, 3:24 PM
Pranali Savane
Pranali Savane - avatar
0
Hello, World Hello,Java
12th Dec 2023, 3:31 PM
Pranali Savane
Pranali Savane - avatar