Quick Q: Does the default constructor initialize built-in types?

Save to:
Instapaper Pocket Readability

Quick A: No.

Recently on SO:

Does the default constructor initialize built-in types?

Implicitly defined (by the compiler) default constructor of a class does not initialize members of built-in types.

However, you have to keep in mind that in some cases the initialization of a instance of the class can be performed by other means. Not by default constructor, nor by constructor at all...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.