There is no exception thrown in class A. How is it possible to instantiate the class A inside the try.. catch. I expected a error, "there is no exception thrown in class A". Can anyone clarify this?
[ June 19, 2002: Message edited by: Thiru Thangavelu ]
Notice that your catch block catches "Exceptions". It doesn't catch IOException. One of the descendents of Exception is RuntimeException. As RuntimeExceptions need not be declared, you are free to try to catch them at any time. If you change that catch block to catch an IOException, I'll bet you'll get the compiler error you expected. Corey [ June 19, 2002: Message edited by: Corey McGlone ]
Originally posted by Thiru Thangavelu: how about Throwable?
Only descendents of Exception (with the exclusion of RuntimeException) are considered checked exceptions. Anything else (RuntimeException and anything higher on the inheritance hierarchy) is not checked. Corey