concept default constructor in category java

appears as: A default constructor, default constructors, default constructor, default constructor, The default constructor
Java SE 11 Programmer I Certification Guide

This is an excerpt from Manning's book Java SE 11 Programmer I Certification Guide.

Exam objectives covered in this chapter

What you need to know

 

[7.1] Create methods and constructors with arguments and return values

Creation of methods with correct return types and method argument lists.

Creation of methods with the same names, but a different set of argument lists.

 

[7.2] Create and invoke overload constructors

Difference between overloading methods and constructors.

A default constructor isn’t the same as a no-argument constructor.

Java defines a no-argument constructor when no user-defined constructors are created. User-defined constructors can be overloaded.

[7.3] Apply the static keyword to methods and fields

The implication of defining fields and methods as static members.

 

In this case, which method creates the instance of the class Employee? Figure 8.7 shows what happens when a class (Employee) is compiled that doesn’t define any constructor. In the absence of a user-defined constructor, Java inserts a default constructor. This constructor doesn’t accept any method arguments. It calls the constructor of the super (parent) class and assigns default values to all the instance variables.

Figure 8.7 When the Java compiler compiles a class that doesn’t define a constructor, the compiler creates one for it.

Exam tip The accessibility of a default constructor matches the accessibility of its class. Java creates a public default constructor for a public class. It creates a default constructor with package access for a class with package-level access.

OCA Java SE 8 Programmer I Certification Guide

This is an excerpt from Manning's book OCA Java SE 8 Programmer I Certification Guide.

[6.3] Create and overload constructors; including impact on default constructors

Figure 3.21. When a class with a constructor is compiled, the Java compiler doesn’t add a default constructor to it.
protected
private
public