Tutorial by Examples

This code contains an overloaded method named Hello: class Example { public static void Hello(int arg) { Console.WriteLine("int"); } public static void Hello(double arg) { Console.WriteLine("double"); } public static vo...
The following program: class Program { static void Method(params Object[] objects) { System.Console.WriteLine(objects.Length); } static void Method(Object a, Object b) { System.Console.WriteLine("two"); } static void Main(string[] a...
If you have void F1(MyType1 x) { // do something } void F1(MyType2 x) { // do something else } and for some reason you need to call the first overload of F1 but with x = null, then doing simply F1(null); will not compile as the call is ambiguous. To counter this you can do F1...

Page 1 of 1