I think the best practice is to have single primary constructor to which the overloaded constructors refer to by calling this()
with the relevant parameter defaults. The reason for this is that it makes it much clearer what is the constructed state of the object is - really you can think of the primary constructor as the only real constructor, the others just delegate to it
One example of this might be JTable
- the primary constructor takes a TableModel
(plus column and selection models) and the other constructors call this primary constructor.
For subclasses where the superclass already has overloaded constructors, I would tend to assume that it is reasonable to treat any of the parent class's constructors as primary and think it is perfectly legitimate not to have a single primary constructor. For example,when extending Exception
, I often provide 3 constructors, one taking just a String
message, one taking a Throwable
cause and the other taking both. Each of these constructors calls super
directly.