Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
PHP: added public visibility keyword
Line 70:
 
In Java, C# and VB .NET the constructor creates objects in a special memory structure called
[[heap (data structure)|heap]] for reference types. Value types (such as int, double etc.), are created in a sequential structure called [[stack (abstract data type)|stack]].
VB NET and C# allow use of ''new'' to create objects of value types. However, in those languages even use of new for value types creates objects only on stack.