\"It is important to point out that the content field of the template is by default set to null (as Java does with all noninitialized object fields upon creation).\"
Yes, this is true, but it may not mean quite what you think it means. All object fields will be initialized to null
if no value is specified, but primitive types have other default values. For instance, int
fields default to 0
, float
s to 0.0
, and boolean
s to false
.
More information on these defaults here: http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html.
It is probably true, but if you really want to be sure that content
starts as null, then set it explicitly. (Doing this also makes it more clear that your code intends content
to be null initially.)
public String content = null;