// "p" is now pointing to a new object on the heap!
p = new Person("Nikki", 999);
}
As you might expect, this allows complete flexibility of how the callee is able to manipulate the
incoming parameter. Not only can the callee
change the state of the object,
but if it so chooses, it
may also reassign the reference to a new Person type. Now ponder the following updated Main()
method and check Figure 4-14 for output:
static void Main(string[] args)
{
Do'stlaringiz bilan baham: