我们可以将抽象类定义为静态吗? [英] Can we define abstract class as a static?

查看:290
本文介绍了我们可以将抽象类定义为静态吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以将抽象类定义为静态吗?

Can we define abstract class as a static?

推荐答案

不,,因为

抽象类包含应在派生类中实现的抽象方法。类定义中的 static 关键字意味着类中的所有方法也是静态的。但静态方法不能被继承或覆盖,这就是为什么它们不能是抽象的。
No,, because
Abstract classes contain abstract methods that should be implemented in derived classes. static keyword in class definition means that all methods in the class are static as well. But static methods cannot be inherited or overridden, and that is why they can''t be abstract.


http://beyondrelational.com/modules/17/interview-questions/ 230 / interview-questions / 15268 / can-we-define-abstract-class-as-a static.aspx [ ^ ]


这篇关于我们可以将抽象类定义为静态吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆