抽象类 [英] abstract classes
本文介绍了抽象类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
抽象类和接口之间的区别是什么?
what is difference between abstract classes and interface
推荐答案
尝试使用google来解决此类问题是否会对您造成伤害?在返回的43多个结果中,这是第一个:
抽象类与接口 [
Would it hurt you to try using google for questions like this? Among the more than 43 THOUSAND results returned, this was the first one:
Abstract Classes vs Interfaces[^]
AFAIK,接口只是合约,即签名.一个抽象类可以具有方法定义,但至少有一个带有修饰符abstract的项,从而使整个类抽象.
这就是我记得的方式.希望我不会走得太远.
(自从我开始使用Java以来已经很长时间了)
干杯
曼弗雷德(Manfred)
AFAIK, an interface is only a contract i.e. signatures. An abstract class can have method definitions but at least one item with the modifier abstract thus making the whole class abstract.
That''s the way I remember it. Hopefully I''m not to far of track.
(It''s been a long time since I had to do with Java)
Cheers
Manfred
这篇关于抽象类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文