A
AJ
Why does the following behave as it does...?
public class Base
{
public void Add( byte b )
{
}
}
public class TestClass : Base
{
public void Add( int s )
{
byte x = 0;
Add( x );
}
}
then call with
new TestClass().Add( 10 );
-> The Add(int) override gets called (good). Which in turn class the
___Add(int)___ override.
Why doesn't this second call hit the base class's Add( byte ) ??
[It works as I'd expected if the Add(byte) method is defined in
TestClass rather than Base, or you call base.Add(x) ]
public class Base
{
public void Add( byte b )
{
}
}
public class TestClass : Base
{
public void Add( int s )
{
byte x = 0;
Add( x );
}
}
then call with
new TestClass().Add( 10 );
-> The Add(int) override gets called (good). Which in turn class the
___Add(int)___ override.
Why doesn't this second call hit the base class's Add( byte ) ??
[It works as I'd expected if the Add(byte) method is defined in
TestClass rather than Base, or you call base.Add(x) ]