// Calls int version of Add()
Console.WriteLine(Add(10, 10));
// Calls long version of Add()
Console.WriteLine(Add(900000000000, 900000000000));
// Calls double version of Add()
Console.WriteLine(Add(4.3, 4.4));
Console.ReadLine();
}
The Visual Studio 2008 IDE provides assistance when calling overloaded members to boot.
When you type in the name of an overloaded method (such as our good friend Console.
WriteLine()), IntelliSense will list each version of the method in question. Note that you are able
to cycle through each version of an overloaded method using the up and down arrow keys shown
in Figure 4-4.
Figure 4-4.
Visual Studio IntelliSense for overloaded members
Do'stlaringiz bilan baham: |