J
James Gockel
Im a newbie, but heres my input.
why don't you try
d.me
since d is the derived class?
-James
why don't you try
d.me
since d is the derived class?
-James
static void Main(string[] args)
{
DerivedClass d=new DerivedClass();
BaseClass b=d;
b.me() <<<<<<<<<<<<<<<<<<<<<This should run DerivedClass.Me() and return
the reference to a DerivedClass BUT IT DOESNT. It executes BaseClass.me
INSTEAD.
new public DerivedClass me()
David said:OK I'll be more specific. This is what I have now (PSEUDOCODE again):
public class BaseClass
{
public virtual Node me()
{
return this;
}
}
public class DerivedClass: BaseClass
{
new public DerivedClass me()
{
return this;
}
}
static void Main(string[] args)
{
DerivedClass d=new DerivedClass();
BaseClass b=d;
b.me() <<<<<<<<<<<<<<<<<<<<<This should run DerivedClass.Me() and return
the reference to a DerivedClass BUT IT DOESNT. It executes BaseClass.me
INSTEAD.
Please help if you've got any ideas.
Cheers
Dave
David said:OK I'll be more specific. This is what I have now (PSEUDOCODE again):
public class BaseClass
{
public virtual Node me()
{
return this;
}
}
public class DerivedClass: BaseClass
{
new public DerivedClass me()
{
return this;
}
}
static void Main(string[] args)
{
DerivedClass d=new DerivedClass();
BaseClass b=d;
b.me() <<<<<<<<<<<<<<<<<<<<<This should run DerivedClass.Me() and
return the reference to a DerivedClass BUT IT DOESNT. It executes
BaseClass.me INSTEAD.