What is doing the New? Please give me answer. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is doing the New? Please give me answer.

26th Aug 2019, 6:21 PM
Руслан
Руслан - avatar
3 Answers
+ 2
Could you be more specific with your answer ?
26th Aug 2019, 6:23 PM
Minerals2016
Minerals2016 - avatar
+ 1
I would like to know what exactly is the name NEW used in objects for? Does it create a link? I heard about some kind of constructor, but there is not much written about it here. Please give a detailed answer.
26th Aug 2019, 6:30 PM
Руслан
Руслан - avatar
0
In most of object-oriented langages, like c++ and Java, the new keyword is used to create a new instance of an object an call the constructor of the base class. It usually create the object on the heap.
26th Aug 2019, 7:01 PM
Théophile
Théophile - avatar