Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They may be ellided entirely if there is a superclass constructor without any parameters.

In all other cases, either super(...) or this(...) MUST be called exactly once. Additionally, you can't catch Exceptions thrown by a call to super(...) or this(...) (so you can't call them inside a try{} block). Finally, you can't reference any non-static members of the "this" object except to write to write to a field.

So yes, the rule is significantly more complex.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: