Classes are automatically given default constructors if no constructor is defined. So, class X will be given a default constructor, while class Z will not. Obviously, a parameterless constructor is provided in Y.
•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).
•Default constructor is created only if there are no constructors. If you define any constructor for your class, no default constructor is automatically created.
Java: Constructors