+ 1

Difference between object & constructor storage?

how constructor is different from object incase of memory allocation?

14th Dec 2017, 6:29 PM
ABDUL RAFEEQ
2 ответов
+ 1
Constructor is only an instruction how to create object it don't allocate more memory than characters written in it. Object is created from constructor's instruction and its all.
14th Dec 2017, 6:38 PM
Maksym Zieliński
Maksym Zieliński - avatar
- 1
constructors never provide memory in the heap, it is the new keyword that provide memory or create new object dynamically. Constructors are just used to initialize the object.or provide default values to the instance members
17th Dec 2017, 8:39 AM
Shivam Varshney
Shivam Varshney - avatar