【发布时间】:2009-08-05 00:35:47
【问题描述】:
如果我有课:
public blah
{
}
然后我有另一个继承 blah 的类"
public ablah : blah
{
}
那我可以这样做吗?
public class Someservice
{
public bool SomeBlah(blah b)
{
}
}
我可以将其称为带有 blah 或 ablah 类的服务吗?
即。
Someservice s1 = new Somesercie();
s1.SomeBlah(new blah());
s1.SomeBlah(new ablah());
我在某处看到了这个,我认为这只有在使用接口的情况下才有可能?
【问题讨论】:
-
这个问题可以通过你的几个键来回答。有人同意它应该关闭吗?
标签: c# inheritance interface