8.6.7 Default Constructor

If a class contains no constructor declarations, then a default constructor that takes no parameters is automatically provided:

A compile-time error occurs if a default constructor is provided by the compiler but the superclass does not have a constructor that takes no arguments.

If the class is declared public, then the default constructor is implicitly given the access modifier public (§6.6); otherwise, the default constructor has the default access implied by no access modifier. Thus, the example:


public class Point {
	int x, y;
}

is equivalent to the declaration:


public class Point {
	int x, y;
	public Point() { super(); }
}

where the default constructor is public because the class Point is public.