Meaning & use
constructor
Last updated
Meanings
nouncountable
A person or company that builds things, especially large structures or machines.
Grammar: Countable noun: a constructor, the constructor, constructors.
Patterns
- a constructor of something
- the constructor of a building
The constructor of the bridge was praised for finishing ahead of schedule.
She works as a constructor for a company that builds wind turbines.
nouncountablecomputingtechnical
In programming, a special method that creates and initializes a new object.
Grammar: Technical term; often used with 'class' or 'object'.
Patterns
- a constructor for a class
- call a constructor
- define a constructor
In Java, a constructor has the same name as the class.
The constructor initializes the object's properties when it is created.
Word forms
| plural | constructors |
|---|
Common combinations
- call a constructor
- When you create a new instance, the program automatically calls a constructor.
- default constructor
- If you don't define any constructor, the compiler provides a default constructor.
- constructor method
- The constructor method sets up the initial state of the object.
- building constructor
- The building constructor hired more workers to meet the deadline.
Synonyms and how they differ
- builder
- More common for a person who builds houses or other structures; 'constructor' is often used in technical or formal contexts.
- maker
- General word for someone who makes things; 'constructor' specifically suggests building large or complex things.
- initializer
- In programming, a broader term; 'constructor' specifically creates and initializes an object.
Opposites
Word family
- construct verb
- To build or create something.
- construction noun
- The process or business of building things.
- constructive adjective
- Helpful and intended to improve something.
Commonly confused: constructor or constructor?
constructor vs constructor
Not to be confused with 'constructor' vs 'constructor' – no common confusion; but learners sometimes mix with 'constructor' and 'constructor'.
Practice
In object-oriented programming, what is a constructor?
Choose one answer.
A constructor is specifically used to create and set up a new object. A method that destroys an object is a destructor; a variable holds data; a loop repeats code.
Make it your own
Write a sentence using “constructor”, then check it and compare it with the examples above.