asp.net 虚方法、抽象方法、接口疑问
一、抽象类中可以提供非抽象的执行方法吗?接口呢? 答:抽象类可以这么写: 代码如下:public abstract class A { public string getWebUrl() { return “jb51.net”; } public abstract string getWebName(); } public class B : A { public override string getWebName() { return “软件开发网”; } } 运行: B b = new B(); Response.Write(b.getWebUrl()); 编译通过没有错误,而接口本身
下载地址
用户评论