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.