Default Constructor
say it: “dih-FAWLT kun-STRUK-ter” /dɪˈfɔlt kənˈstrʌktər/
A no-argument constructor supplied by the compiler when a class declares none.
What is Default Constructor in Java?
Default Constructor — A no-argument constructor supplied by the compiler when a class declares none.
class Book {
String title;
Book(String title) {
this.title = title;
}
}
Level: Journeyman · More Java terms at this level
Updated