Questions tagged [constructors]
The constructors tag has no usage guidance.
3
questions
9
votes
4
answers
2k
views
What are the approaches of protecting against partially initialized objects?
An object is partially initialized if the program execution didn't exit their constructor yet. Usually the programmer is responsible for not leaving partially initialized objects in unwanted places ...
4
votes
4
answers
366
views
Options of the relationship between classes and constructors
Given a class and its constructor to be defined, what are some options of where to put them logically relative to each other? What are the pros and cons of each of them?
For example, is a class and ...
5
votes
2
answers
244
views
Why do languages differ about when `super` must be called in a constructor?
Many languages require you to call super before setting your own properties, like in TypeScript:
...