In classical object-oriented programming languages, a constructor is a special method used to initialize a newly created object once memory has been allocated for it.