Re: A question on JFrame constructor.

Re: A question on JFrame constructor.

Originally Posted by fatabass

Can someone verify sunde887 ?

JLS 8.8.7 "If a constructor body does not begin with an explicit constructor invocation and the constructor being declared is not part of the primordial class Object, then the constructor body is implicitly assumed by the compiler to begin with a superclass constructor invocation "super();", an invocation of the constructor of its direct superclass that takes no arguments."

So consider it verified (except to mention that in the case of an enum type, you can't call it explicitly.)

-----

And, yes, if you call it explicitly you can catch the exception and not otherwise. It is unlikely that you want to catch this exception however. See JLS 8.8.7.1 for the gruesome detail on explicit superclass constructor invocation.