Home Object methods and constructors

Extra public functionality

You should not include extra public methods beyond what the spec instructs you to include. Any helper methods you make must be kept private.

Duplicate constructors

When writing classes with multiple constructors that share many similarities, you should always try and structure your constructors such that they all delegate to one single, general constructor instead of repeating your initialization logic.

Method independence

When writing objects, you should take care to ensure that no single method relies on any other method being called first, or in any particular order.

The only thing you may assume is that one of your constructors will be the very first thing that is run. Apart from that, anything goes.