Is a default constructor responsible for initializing members to default values?

273 Views Asked by At

A default constructor initializes all instance and class members to its default value.

is above statement True or False?

1

There are 1 best solutions below

2
On

No. The default constructor does nothing other than call super().

Instance fields are always initialized to their default values before any constructors are run (it isn't the constructor that does it).

And, of course, static fields ("class members") are not initialized by a constructor. That'd be silly.