Since a Constructor is simply a method, you can overload the Constructor. Recall from earlier in this chapter that overloading a method means that you can have different implementations of your method based on a different method signature.
I could create another Constructor that allows me to initialize the values as soon as I create an instance of the class:
public Car(string make, string model, int elapsedMileage)
_ model = _model; elapsedMileage =
Then, this is how I would use that constructor when I create a new instance of the class:
myCar = new Car("Nissan",
Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET