aspose file tools*
The moose likes Beginning Java and the fly likes End of file while parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "End of file while parsing" Watch "End of file while parsing" New topic
Author

End of file while parsing

Subhashish Pattnaik
Greenhorn

Joined: Nov 07, 2010
Posts: 14

Dear all, am a newbie to this enthralling world of java.
The other day when i was trying putting in my head into the norms of inheritance, i found that a subclass object was unable to invoke a the constructor for the base class. and when i tried sorting the same by putting in a constructor for the subclass and then invoking it by the subclass object i came across this "end of file while parsing problem".
I am pretty sure that something is wrong.... perhaps with my understanding!! could someone help me over this.

Regards
Subhashish


Subhashish Pattnaik
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

What could that be ? Forgot to close a statement or a class ? It's difficult to say without seeing your code, without knowing when it happens (at compile time ?), where (console, IDE?), and what the exact error message is.


[My Blog]
All roads lead to JavaRanch
Subhashish Pattnaik
Greenhorn

Joined: Nov 07, 2010
Posts: 14
Many thanks Verre for having taken the time to reply back to the post.

This is the program which should give you a better insight of all the happenings.




Hope this program should be quite familiar to you.
I need your help in sorting this out which shows me "end of file while parsing" every time i compile it. I am executing these programs in the concsole mode.

Regards
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14272
    
  21

Welcome to JavaRanch.

Please UseCodeTags when you post source code (I added them this time for you - I'm a moderator so I can edit your post).

About your problem: You forgot a closing } around line 56.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

1. Give your class a name starting with a capital letter
2. You need at least one public class, the one with the main method
3. You need to close class boxwt (closing bracket missing)
4. You need to format your code clearly. This will help you spot unclosed brackets

And next time that you want to post some code, please UseCodeTags. (and welcome to the ranch )
Bobby Smallman
Ranch Hand

Joined: Sep 09, 2010
Posts: 107
Those sneaky } jerks! I assume because of this error it means you are learning without a fancy schmancy IDE like Eclipse or Netbeans. Learning java with a more simple text-editor can be great for developing your mind to see errors in code and can be very beneficial if you end up going for certification, so keep up the good work! Oh yeah...I almost forgot... Welcome to the Ranch Subhashish!


Everyday in every way, we get a little better.
Subhashish Pattnaik
Greenhorn

Joined: Nov 07, 2010
Posts: 14
Oh am extremely sorry for not having put the indentations and made the use of "UseCodeTags" . Will keep that in mind,the next time i trouble u.

And many thanks to you guys in person (Jesper,Verre and Bob)!!
Obliged to you for having got such a prompt reply inspite of your busy schedule.

I will better go through the snippets of "As to how to post questions", the next time i bug you!!

All smiles

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
Welcome to the Ranch

You shouldn't write code the way you think you should write code. Most people think you write code like this . . . but you shouldn't That is how you would write a letter, but that method makes it easy to get your {} paired incorrectly. Write it like thisThat way you will always have the {} in pairs. Make sure to indent them correctly; MS NotePad is no used for that; try NotePad2 or NotePad++ or jEdit, which support bracket highlighting, automatic indentation, etc.
 
jQuery in Action, 2nd edition
 
subject: End of file while parsing