Dim s1 As new SavingsAccount(50);
Dim s2 As new SavingsAccount(100);
Dim s3 As new SavingsAccount(10000.75);
Console.ReadLine();
}
the in-memory data allocation would look something like Figure 5-5.
Figure 5-5.
Static data is allocated once and shared among all instances of the class.
Let’s update the SavingsAccount class to define two static methods to get and set the interest
rate value:
Do'stlaringiz bilan baham: