Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Java error reached end of file while parsing 
 

Java Error reached end of file while parsing occurred when a programmer do not close the class braces properly.

 

Java error reached end of file while parsing

                         

Java Error reached end of file while parsing  occurred when a programmer do not close the class  braces properly.

Understand with Example

In this Tutorial we want to describe you a code that help you in understanding  java error reached end of file while parsing ,In this code we want to display Time in hour, minute and second. For this we have a class name Reachedendof filewhileparsing,Inside this class we have a main method that declare a string, format name variable. We create an instance of class date and assign to a memory. The current hour, minute and second  is store in a variable f,that is further used to call format and date object passed as parameter in string variable. The System.out.println is used to display the time from the string. But on execution the code show an error i.e java error reached end of file while parsing as the class closing braces is not specified.

Reachedendoffilewhileparsing.java

import java.text.*;
import java.util.Date;

public class Reachedendoffilewhileparsing {

    public static void main(String args[]) {

        String string;
        Format f;
        Date date = new Date();

        f = new SimpleDateFormat("hh:mm:ss ");
        string = f.format(date);
        System.out.println("Time is : " + string);

    }

Output

Compiling source file to /home/girish/NetBeansProjects/errors/build/classes
/home/girish/NetBeansProjects/errors/src/
Reachedendoffilewhileparsing.java:
17: reached end of file while parsing

    }
error
BUILD FAILED (total time: seconds)

To resolve this error you have to close the class properly by giving brace.

Download code

                         

» View all related tutorials
Related Tags: c class ant help property get tutorial name ria this for to e des pe in as sta m nt

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.