This is Just for my understanding.Objects which are class members go into heap while local variables and value types got o stack.Is there a usecase and possibilty to push the object to Stack or heap forcibly?
This is Just for my understanding.Objects which are class members go into heap while
Share
No. Objects go into the heap.
No. All local variables are allocated on the stack. If they are references to objects, the objects concerned are in the heap if they exist.
No. You don’t need one. All objects are allocated on the heap.