+ 1
"the constructor is used to create the object"?
"the constructor is used to create the object"? but what I believe is that the object is created first and then the constructor is called. and I also learned that the constructor dose not instantiate the objects. any help plz
2 odpowiedzi
+ 5
Constructor called to initialize object not create.
1 step is memory allocation for this object (actual obj creation)
2 constructor runs, since you could set some values to some obj vars inside of constructir obj should exist in memory.
3 Object created if nothing went wrong.
Sometimes just to skip some details you can see that people say in manner that constructor creates.
+ 5
Constructor is a method which is involved in object creation