Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Polymorphism: SCJP 1.5 Part2 - Question: 18.

 
Alam Ameghino
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends.

This is a question about polymorphism.

The exercise is the next:

The options are:

1.) #1
2.) #2
3.) #3
4.) #4
5.) Nowhere, since this program does not compile
6.) This program is not valid and hence there is no poymorphism

The correct answers are 2) y 3), but for me it is wrong. For me there isn't polymorphism in previous example.


Polymorphism is present in the next exercise. Here, in runtime, JVM decide what m() method is called.

Am I right?

Thanks!
 
Alam Ameghino
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, and the explication is: "Polymorphism is exhibited wherever a base class calls a subclass implementation".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic