Bookmark Topic Watch Topic
  • New Topic

Runtime and Compiletime

 
John Paterson
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue the discussion in your duplicate thread here http://www.coderanch.com/t/584125/java-programmer-SCJP/certification/run-time-compile-time
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic