Meaningless Drivel is fun!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Runtime and Compiletime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic

Runtime and Compiletime

John Paterson
Ranch Hand

Joined: Mar 12, 2012
Posts: 170
Hi folks...

Do have a look at the following code:

Is it true that at comple time it's checked if the 'eat' method exists in the Animal class and at runtime Java selects the actual version of the method that is to be run, which in this case for object ref b it would have to be the eat method of the 'Horse' class??

Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Please continue the discussion in your duplicate thread here

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: Runtime and Compiletime
It's not a secret anymore!