由网友(旋风小土豆)分享简介:我是新来的C#的是下面的语句在C#中的等价公共类的狮子伸出动物实施日(){}解决方案 动物是基类在日是一个接口继承可以这样声明。公共类金狮:动物,日{}在 C#,你可以继承一个基类,可以有多个接口。另外一个技巧,如果你正在一个接口在C#中,用 preFIX它,我。例如, IDiurnal I am new...
我是新来的C#的是下面的语句在C#中的等价
公共类的狮子伸出动物实施日()
{
}
解决方案 动物是基类 在日是一个接口
继承可以这样声明。
公共类金狮:动物,日
{
}
在 C#
,你可以继承一个基类,可以有多个接口。
另外一个技巧,如果你正在一个接口
在C#中,用 preFIX它,我
。例如, IDiurnal
I am new to C# what is the equivalent of following statement in C#
public class Lion extends Animal implements Diurnal()
{
}
解决方案
Animal is Base class Diurnal is an Interface
the inheritance could be declared like this.
public class Lion : Animal, Diurnal
{
}
In C#
, you can inherit one base class and can be multiple Interfaces.
One more tip, if you are making an Interface
in C#, prefix it with I
. eg IDiurnal
相关推荐
最新文章