Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
why it is mandatory to use "new" operator to consume a referance type where as it is optional for a value type
Posted

1 solution

I don't program much in C# but I would think it is to enforce a clear distinction where is an object is located. A value type object is located on stack and reference type object is located on heap. I guess this also means that reference needs to be deallocated either by garbage collection or some other means.

-Saurabh
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900