如何创建抽象方法 [英] how to create abstract method
本文介绍了如何创建抽象方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何创建 abstract
方法?
推荐答案
抽象方法很容易创建:
Abstract methods are easy to create:
public abstract class MyBase
{
public abstract string MyMethod(string s);
}
然后在创建派生类时,必须在类编译之前创建一个定义。
Then when the derived class is created, it must create a definition before the class will compile.
像这样:
http://msdn.microsoft.com/en-us/library/aa664435(v = vs.71).aspx [ ^ ]
方法不能是抽象的,类可以是抽象的。
Methods can not be abstract, classes can be abstract.
这篇关于如何创建抽象方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文