Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does object reside in c#?

Tags:

java

c#

i am a java programmer and i know in java objects are stored on heap. Just for curiosity wanted to where does objects reside in c#.

like image 793
GuruKulki Avatar asked Dec 13 '22 00:12

GuruKulki


1 Answers

  • For reference types : on the heap
  • For value types : on the stack for local variables and method parameters, or on the heap for members of a reference type
like image 112
Thomas Levesque Avatar answered Jan 28 '23 03:01

Thomas Levesque