Is there a difference between defining class attributes and initializing them? Are there cases where you want to do one over the other?
Exampl
In Java, initializing is defined explicitly in the language specification. For fields and array components, when items are created, they are automatically set to the following default values by the system:
numbers: 0 or 0.0
booleans: false
object references: null
This means that explicitly setting fields to 0, false, or null (as the case may be) is unnecessary and redundant.