Object-Oriented Programming

Constructor

English

Overview

Initialization logic that's automatically called when an instance is created.

Details

A special method automatically run when an instance is created, used for tasks such as setting initial field values. When inheritance is involved, the parent class's constructor runs first, implicitly or explicitly -- important to keep in mind when tracing initialization order.

More Programming terms