class Calculate
{
int result;
public int add(int m, int n)
{
result = m + n;
return result;
}
}
class Program
{
static void Main(string[] args)
{
int a, b, c;
a = 10;
b = 20;
Calculate obj;
obj = new Calculate();
c= obj.add(a, b);
Console.WriteLine(c);
Console.ReadLine();
}
}
this is a sample code, I wonder how stack and heap functions, and who variables,methods,class or objects get stored, how stack is functioned line by line execution of code and if 10 objects are create how and where these are stored