• Register
1 vote
30 views

Problem:

Hello Kodlogs,
I’ve written my very first program in java that is supposed to print Hello World. But for some reason, it is not displaying my expected line. It is showing error reached end of the line while parsing. Find my java program below and please, figure out the error.

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

Many thanks guys. I really appriciate your effort.

12 7 7
15,250 points

Please log in or register to answer this question.

1 Answer

1 vote

Solution:

You just missed a curly brace end of your program. Close the brace of your public class end of the program and give it another try. 

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

Now, your program should compile and print your expected things.

Note: Always put the opening and closing braces at the same time and put the code inside it. This is the best practice.

13 9 6
94,260 points

Related questions

0 votes
1 answer 6 views
6 views
Problem: Can anyone tell me the solution of this problem? Reached end of file while parsing error java
asked Apr 25 Ifra 37.2k points
0 votes
1 answer 18 views
18 views
Problem: I am unable to deal with this eror .. can anyone help me to solve java error reached end of file while parsing
asked Mar 25 Ifra 37.2k points
0 votes
1 answer 28 views
28 views
problem;I keep getting the error: reached end of file while parsing. I can't figure out what is wrong.
asked Feb 7 kaash_kashi 1.2k points
0 votes
1 answer 22 views
22 views
What am I doing wrong? Any help appreciated.
asked Dec 30, 2020 TeamScript 13.5k points
1 vote
1 answer 9 views
9 views
Problem: I am unable to find out the solution, Please solve it : java reached end of file while parsing
asked Mar 26 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 14 views
14 views
Problem: Error:reached end of file while parsing. How to solve this error?
asked Mar 21 charles mathews 5.5k points
0 votes
1 answer 5 views
5 views
PROBLEM : Is there anyone to helo on > 'reached the end of the file while parsing' ?
asked Mar 17 Samiur1 38.4k points
0 votes
1 answer 17 views
17 views
Problem: reached end of file while parsing in java
asked Feb 23 Hira 2.2k points
1 vote
1 answer 22 views
22 views
Problem: I have the following source code below: package com.gavin; public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World !"); } This code returns me an error “reached end of file while parsing java” What could be a possible solution in my case?
asked Mar 7, 2020 Gavin 15.3k points
1 vote
1 answer 4 views
4 views
Problem: Please help me to solve it out : java reached the end while parsing
asked Mar 26 MUHAMMAD MUNEEB 83k points