+ 1
What function "new" actually performs? Sorry if im being too silly to ask this.
6 Antworten
+ 2
"new" calls the constructor of a class
+ 1
oh. thanks mate
0
dayum son! does it call the constructor of a class or creates an object?
0
both? then how do we tell the new method that when to either create an object or call a constructor?
0
It does both at the same time.
The method calls the constructor to initialize the attributes of the object and returns it at the end.
- 1
The "new" method creates an object.