Home Segments Top Top Previous Next

218: Sidetrip

You must include a definition for your own zero-parameter constructor in a class definition under the following condition: You define a constructor with parameters and you create instances using a constructor with no arguments.

The rationale is as follows: If you have not defined a zero-parameter constructor, then the lack of arguments suggests that you have forgotten to include arguments for the parameter-bearing constructor that you have defined.