This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
try block is a way to perform your program . catch blocks tells you or handle what it would be if something goes wrong.thus you must protect your programe and inform the user with all the necessary catch blocks.
khurram can u tell me is finally block is multiple or single ? Michael said the truth. I think the question is not tricky but the concept you need to know Finally block can be single or zero when the try block is single. Because placing the finally block in the coding is not mandatory.
[ May 17, 2003: Message edited by: siu chung man ]
I think there is a sticky wicket. What if there are multiple try calls? Should there be a catch for each try or multiple catches for each try with only one final or multiple finals? I think this is what is being asked. Would it not be true to say only one final call regardless of the number of try / catch combinations? EG
Somebody tell me if I screwed something up, but I think this is a general idea? :roll: [ June 03, 2003: Message edited by: Donald R. Cossitt ]
Doco I think you example looks good, you can have nested try/catch blocks, I believe from a syntax perspective though you have to have as a minimum a try/catch(s) or a try/finally and of course you can always do try/catch(s)/finally. Although you show you're nested try/catch calls here in one method, I think you will also find them scattered thru different method calls and different classes where the nesting may not be as apparent. This would allow the exception to bubble up to the calling method or try/catch block for handling.
Donald R. Cossitt
Joined: Jan 31, 2003
Yeah it is a bit of a cobble. I was just being a bit outrageous for effect Marilyn and Jason have been doing a great job working that out of me though.