Error in printing hello world | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Error in printing hello world

Myclass { public static void main(String[] args) { System.out.println("hello world"); } }

23rd Mar 2020, 3:51 PM
ARMY prime
3 Answers
+ 1
ARMY prime Class declaration syntax is class Class_Name { //Data and properties goes here.. .. } in your code class MyClass //you missing class keyboard here. { public static void main(String args[]) { System.out.println("hello world"); } }
23rd Mar 2020, 3:57 PM
Jayakrishna 🇮🇳
+ 1
ARMY prime When you are going to define something you should tell their type. Like if you are making class you should write like this:- class Class_Name { } when you are going to write method you should declare which type of method and what will return like this:- void methodName() { } Or int methodName () { } When you are going to make Interfare you should write interface before the interfaceName like this:- interface interfaceName { }
23rd Mar 2020, 4:28 PM
A͢J
A͢J - avatar
0
We need to write like class MyClass. and remember that java is a case sensitive language
24th Mar 2020, 10:59 AM
Samavedam Praneeth
Samavedam Praneeth - avatar