开发者

polymorphism without virtual methods

According to book SCJP Sun Certified Programmer for Java 6 Study Guide, "all java objects are polimorphic".

class B {} class A 开发者_运维知识库extends B {}

Class A doesn't have any overriden methods. Is it polymorphic ?


Definitely, because class B extends Object and Object has a few methods already.


By default every object inherits from Object so overall the answer is yes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜