Constructor

Noun · Development

Definitions

  1. A special method that is automatically called when an object is instantiated from a class, responsible for initializing the object's state. In Python it is __init__, in Java and C++ it shares the class name, and in JavaScript it is the constructor() method.

    In plain English: The setup code that runs automatically when you create a new object, setting its starting values like filling out a new-hire form.

Related Terms