java - Why does Catch(object o) cause a compile error? -


try {  } catch(object o) {  } 

why leads compile error ? since objects inherit object class.

you can catch objects derive throwable.

see throwable (java platform), states:

the throwable class superclass of errors , exceptions in java language. objects instances of class (or 1 of subclasses) thrown java virtual machine or can thrown java throw statement. similarly, class or 1 of subclasses can argument type in catch clause.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -