Java: Default constructor

This entry is part 28 of 54 in the series Learn Java

It is possible to create a class even if no constructors are defined.

This is because the compiler will then automatically create a default parameterless constructor.

package javaapplication21;

public class Print {

    public static void main(String[] args) {

        Print print = new Print();


    public void printOut() {


Series Navigation<< Java: Constructor chaining
Java: Null object >>

Leave a comment

Leave a Reply