Jump to content

Talk:Constructor (object-oriented programming)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 202.74.216.218 (talk) at 10:38, 13 November 2006 (Constructors in other languages). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Is a constructor really a method? I'd rather propose to say: a constructor is an operation AND a method is an operation, too. I.E. a method may have different return types whereas a constructor's return type should be clear. You might define a constructor as a special method with a constraint about its return type but defining them as different metaclasses seems to be a better (and proper) solution.

Constructors should not be considered as a method as the declaration syntax is very different from normal methods, and it cannot be called by other methods directly (it can be called indirectly by creating a new instance object). T4bits 15:24, 8 November 2005 (UTC)[reply]

Constructors in other languages

Does anyone know about contructors in other languages? It would be a great help, especially since the current article is mostly based on C++

Hello. I added a php one.. hope it helps. :-)

constructor

dd