开发者

polymorphism without virtual methods

开发者 https://www.devze.com 2023-03-08 11:08 出处:网络
According to book SCJP Sun Certified Programmer for Java 6 Study Guide, \"all java objects are polimorphic\".

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

精彩评论

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