In .NET, an integer data type is a value type (stack), and String is a reference type (heap).
So, if class A has an integer and an object of type string in it, and class B creates an object of class A, then how will this object of class A be stored in memory? On the stack or on the heap?
This was asked in my interview with Microsoft. You need to understand how I lived.
source
share