In .NET, integer data type is a value type(stack) and String is a reference type(heap).
So If a class A has an integer, and a string type object in it, and a class B creates an object of class A, then how will this object of class A be stored in memory? In stack, or in a heap?
This was asked in my Microsoft interview. Need to understand how I fared.
Eric Lippert just wrote about this:
The true story is:
Most importantly, he stresses that you simply should not care where a type lives. You should care where things of a certain lifetime live.