aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Overloading, Overriding, and polymorphic call... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Overloading, Overriding, and polymorphic call..." Watch "Overloading, Overriding, and polymorphic call..." New topic
Author

Overloading, Overriding, and polymorphic call...

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561

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?


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Vidya Krishnamurthi
Greenhorn

Joined: Jan 12, 2003
Posts: 18
yes u r right .
tanushree jana
Greenhorn

Joined: Jun 05, 2003
Posts: 3
yup its right
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overloading, Overriding, and polymorphic call...
 
Similar Threads
doubt var arg
Polymorphic call to method from constructor?
Polymorphism and casting
instance varibles and static methods????
K&B Chapter 10 Self Help Question 9