WordGarden.io

constructor

B1
Uncommon

Pronunciation

UK

  • /kənstrˈʌktə/

US

  • /kənˈstrəktər/

Meanings

Noun

  1. a person or company that constructs buildings or other structures

  2. a special method or function that creates and initializes an object in programming

Beyond the definition

A constructor isn’t just someone who builds houses. It can mean the person or company responsible for building a project—especially in formal writing about construction. In programming, it means a special method that creates a new object and sets it up.

The word comes from the Latin construere, meaning "to build together." In construction, the constructor brings together workers, tools, and materials to turn plans into a real structure. In programming, the constructor runs when an object is created and gives it its first values. You might read, "The constructor is responsible for site safety," or "This class’s constructor sets a default role for new user profiles."

Examples

  1. 1

    Java objects

    In Java, the constructor runs when you create a new object.

  2. 2

    Overloaded constructors

    This class has two constructors: one with no arguments and one that takes a name.

    • Phrasewith no arguments

      without any input values

  3. 3

    Inheritance

    The child class must call the parent constructor first.

  4. 4

    Access control

    We made the constructor private so users can't create the class directly.

    • Domain

      in programming, private means only usable inside the class

More examples
  1. 5

    Setup code

    Most of the setup code belongs in the constructor, not in every method.

See also

Similar

Shades of meaning

Contrast

Used with (collocations)

  • constructor of roads
  • constructor of bridges

Word family

Explore

  • civil engineering
  • project management

Forms and spellings

2 forms open this card.

Main spelling

  • constructornoun

Forms

  • constructorspluralnoun