rafal
rafal

Reputation: 9

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 ?

Upvotes: 0

Views: 133

Answers (2)

RMT
RMT

Reputation: 7070

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

Upvotes: 2

Marcelo
Marcelo

Reputation: 11308

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

Upvotes: 4

Related Questions