I'm using C # and I got the following doubt,
In a class in which I define a calculated read-only property, for example, a simple class
public class UnaClase
{
public int Num1 { get; set; }
public int Num2 { get; set; }
public int Suma
{
get
{
return Num1 + Num2;
}
}
public UnaClase(int num1,int num2)
{
Num1 = num1; Num2 = num2;
}
}
At what moment in the life cycle of an instance of UnaClase
will the calculation Num1+Num2
be made?
When creating the instance or each time I use the property?