• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ExceptionTest

 
Venkat Ramsimha
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There will be no output from this program. There is no main method.
 
Henry Wong
author
Marshal
Pie
Posts: 21490
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rohan Kayan
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There will be compilation error the method test should explicitly catch the exception or it should put them in throws caluse .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic