aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ExceptionTest Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "ExceptionTest" Watch "ExceptionTest" New topic
Author

ExceptionTest

Venkat Ramsimha
Ranch Hand

Joined: Dec 28, 2004
Posts: 127

hi all,
can anybody suggest and explain whts the output for the above program and how its generated?

Thanks,
venkat

( tags and formatted)
[ May 12, 2005: Message edited by: Barry Gaunt ]
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
There will be no output from this program. There is no main method.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16686
    
  19

I don't think program will even compile. The runTest() method is declared to throw a checked exception, which can't happen. The test() method does handle the checked exception or is declared to throw it.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Rohan Kayan
Ranch Hand

Joined: Sep 17, 2004
Posts: 123
There will be compilation error the method test should explicitly catch the exception or it should put them in throws caluse .


SCWCD 1.4, SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ExceptionTest
 
Similar Threads
Doubt in code with exception
understanding try-catch block?
What code can we insert here..
Exception Handling
a question about exception?