I saw a code like this:
private readonly object[] m_Values = { (int)0, (int)0 };
What\'s the idea to cast 0 to int? Isn\'t it int by \'defa
It is not necessary. I'd assume the programmer got bitten before. I'll post it as a puzzler, which overload will be called in this program?
using System;
class Program {
static void Main(string[] args) {
Foo.Bar(0);
Console.ReadLine();
}
}
class Foo {
public static void Bar(byte arg) { Console.WriteLine("byte overload"); }
public static void Bar(short arg) { Console.WriteLine("short overload"); }
public static void Bar(long arg) { Console.WriteLine("long overload"); }
}