Default constructor. If you don't define a constructor for a class, a default parameterless constructor is automatically created by the compiler. The default constructor calls the default parent constructor (super()) and initializes all instance variables to default value (zero for numeric types, null for object references, and false for booleans).
Abimaran Kugathasan wrote:. . . the variable "name" is initialized to null. It's done by the default constructor.
Not quite. The default constructor does nothing with any of the fields; they are filled with default values, which in the case of a reference type is null, at the place of declaration.
It is bad practice to have a class with fields and not set them up in the constructor; it allows your object to be in an inconsistent state.When you first buy a car, it is travelling at a speed of 0. It is best to initialise all fields, even to 0 which is the same as the default value.