This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overloading, Overriding, and polymorphic call...

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

it prints B. I just want to clarify my ideas:
the baz() method is overriden by class B. Since the method is overriden the method to call is only decided at runtime using the object type, in this case B. am I right?
If the method happened to be overloaded (different arguments) then the method to call is decided at compile time, using the reference (in this case A, right?
So.. If I'm right? is this the reason why this is called a polymorphic call?
 
Vidya Krishnamurthi
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes u r right .
 
tanushree jana
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yup its right
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic