This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unchecked exceptions handled programmatically

 
Bob CHOI
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to JAVA API

public class NumberFormatException extends IllegalArgumentException
public class IllegalArgumentException extends RuntimeException


they're unchecked exceptions, is it proper to handle them programmatically? :roll:
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's entirely possible to handle unchecked exceptions programmatically. Whether it's proper may depend on your point of view. It seems that many Java programmers have been raised with a superstiious fear of unchecked exceptions which paralyzes them, preventing intelligent decision making. Don't let this happen to you. Consider exceptions on a case=by-case basis. If you know why an exception was thrown, and you can recover from the exception, then do so. Don't let some inane idea that "unchecked exceptions should not be caught" stop you. Such hopelessly general rules are usually wrong. Think for yourself.
 
Bob CHOI
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim, Thanks for your convincing clarification!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic