• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IO doubt

 
zarina mohammad
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why does this IO program produce no output?:

i was expecting the output to be EOFException.
can someone explain plz.
thanks
zarina
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can it print EOFException, if you don't put in the code to output the exception? You're catching the exception, so it is considered handled, unlike a runtime exception. If you change your catch block to look like this:

I think you'll see what you're looking for.
Corey
 
zarina mohammad
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for correcting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic