• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

out of scope expection

 
U Kvistborg
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one question, it actually came about when I saw some very baad code, but then I just had to see what happend so I made this example, but how can the exception ever be seen if it is out of scope for the catching class to see ?

My main class in one file and in one package.


My throwing class in another package but in one file I have both the thrower class and the runtime exception:



How can the main class actually see the out of scope exception ? I would have guessed that i'll had an out of scope sort of exception not that it actually prints the exception in the main and with the message text in this case just Hej.

[ Edited to use code tags - Paul Sturrock ]
[ January 17, 2007: Message edited by: Paul Sturrock ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced topic. Moving...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic