If i have a class Person
and this class have data members as FirstName
, LastName
.
public Class Person
{
public string firstName {get; set;}
public string lastName {get; set;}
}
Class Person
is a Reference Type but firstName
and lastName
are Value Type. Then how this would be stored? Would Class Person
be stored on Heap and firstName
and lastName
would be stored on stack? Can someone please help me understand how this works exactly?