0

What is the difference between new operator and constructor?

Please explain in short.

20th Dec 2017, 1:50 PM
Shivangi Sharma
Shivangi Sharma - avatar
5 odpowiedzi
0
new calls the constructor. constructor creates the object
20th Dec 2017, 2:07 PM
Jeremy
Jeremy - avatar
0
@jeremy can you share the syntax of both
20th Dec 2017, 2:46 PM
Shivangi Sharma
Shivangi Sharma - avatar
0
no, do the courses
20th Dec 2017, 2:47 PM
Jeremy
Jeremy - avatar
0
@jeremy class Math int m; math m=new math(); this is the syntax of new operator. corrct? where m is the reference to the object of math
20th Dec 2017, 2:51 PM
Shivangi Sharma
Shivangi Sharma - avatar
0
this is all explained in the courses
20th Dec 2017, 2:52 PM
Jeremy
Jeremy - avatar