12
Suppose we have:
public class FooBase
{
public void Write(byte value)
{
//something
}
public void Write(int value)
{
//something
}
}
public class Foo : FooBase
{
public void Write(decimal value)
{
//something
}
}
than this:
var writer = new Foo();
writer.Write(5); //calls Write(decimal) !!
writer.Write((byte)6); //calls Write(decimal) !!
will call Write(decimal) overload. Why? And how can I call Write(int) or Write(byte) ?