This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
"try" means "check out the following piece of code" and if it has a problem find the appropriate catch block and follow those instructions." You will know if it had a problem, because it will throw an exception if it does. "throw" means "a problem has been found and I am going to deal with it by creating an exception object that explains the whole thing and throwing it to the class that called me and hope that that class that has a better idea of what to do with this - since I don't have any good advice". Of course as a rule you end up catching an exception that a lower level class has thrown to you and you have to decide what to do about it. If your class DOES have some good advice, then it can handle the exception itself by catching the exception and dealing with it - or it can deal with it by re-throwing it (hopefully with a better message or whatever).
"JavaRanch, where the deer and the Certified play" - David O'Meara
The difference between checked and unchecked exceptions is that, in case of checkecked exceptions you have to either handle them or leave the handling explicitly to the caller. In case of unchecked exceptions, these exceptions has been implicitly handled by the default Exception Handler of the JVM, that is why the programmer is not required to handle them explicitly. with regards
A java Student saif ullah
Joined: Apr 02, 2002
thanks cindy and saif
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com