Variable names such as
sum actually correspond to locations in the computer’s memory. Every variable has a name, a type, a size (determined by the type) and a value.
In the addition app of Fig. 3.14, when the statement (line 16)
number1 = Convert.ToInt32( Console.ReadLine() );
executes, the number typed by the user is placed into a memory location to which the name
number1 has been assigned by the compiler. Suppose that the user enters
45. The computer places that integer value into location
number1, as shown in Fig. 3.15. Whenever a value is placed in a memory location, the value replaces the previous value in that location—the previous value is lost.