• Register
1 vote
20 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?

12 7 7
15,250 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

In your case, it’s a pretty much basic level problem. It generally happens when we forgot to open or close a curli brace. To avoid this error the best practice is to close the brace immediately once we open a brace.

Here is the correct one:

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

You are all set to go now!

13 9 6
94,240 points

Related questions

1 vote
1 answer 3 views
3 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 7 views
7 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 24.4k points
0 votes
1 answer 10 views
10 views
Problem: reached end of file while parsing in java
asked Feb 23 Hira 2.2k points
0 votes
1 answer 16 views
16 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 18 views
18 views
What am I doing wrong? Any help appreciated.
asked Dec 30, 2020 TeamScript 13.5k points
0 votes
1 answer 5 views
5 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 2 views
2 views
PROBLEM : Is there anyone to helo on > 'reached the end of the file while parsing' ?
asked Mar 17 Samiur1 38.4k points
1 vote
1 answer 28 views
28 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 ... public static void main(String []args){ System.out.println("Hello World"); } Many thanks guys. I really appriciate your effort.
asked Apr 9, 2020 Gavin 15.3k points
1 vote
1 answer 3 views
3 views
Problem: Please help me to solve it out : java reached the end while parsing
asked Mar 26 MUHAMMAD MUNEEB 83k points
1 vote
1 answer 268 views
268 views
Problem: Hello all, I am a new, college student who is learning python programming. I am thinking to write a program that will input a text file and read all the vowels from it and determines when it comes to the end of the file. So, is it possible to create a while loop that determines when the end of a file has been reached? Thanks in advance.
asked Mar 16, 2020 Gavin 15.3k points