File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About a clause in MC selection

 
anson chau
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what exactly is meant by 'An Exception is thrown at runtime?"

(A) A RuntimeException(ONLY exception that extends RuntimeException) will be thrown ?

(B) An Exception is thrown at program running time, no matter it is unchecked or checked.

Thank you.
[ January 07, 2007: Message edited by: anson chau ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I take that to mean 'B'.
 
Paul Lachance
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't it also true that any exception thrown at runtime will also extend RuntimeException (whether progammer or JVM initiated)? I would think both A and B are implied...
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Lachance:
Isn't it also true that any exception thrown at runtime will also extend RuntimeException (whether progammer or JVM initiated)? I would think both A and B are implied...

No. Runtime is the only time your code can throw anything.

RuntimeException is simply a subclass of Exception, and serves as a distinction between checked and unchecked exceptions.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic