0
Why to write "new" after the assignment operator?
4 Answers
+ 2
When you see:
People p = new People();
In the right side of expression. I'm instantiating a object calling the defined constructor in class People.
In the left side i'm declaring the variable tha will store this object.
When im using new i'm saying to "create" a new object of determinate type.
+ 2
"New" operator is used to dinamically allocate memory of variable size which is situated on the right from the operator.
It will return pointer to allocated memory.
+ 2
this depends on the language. new in c++ is completely different from new in other languages such as c#
+ 2
Jordan Chapman True. i just supposed that was java related by the courses progress Yash Paneliya has.