File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method Overriding with Object

 
Srinivas Palam
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the scjp6 book, red colored line should disply Animal, but I am geeting complie error. Please help.




ERROR:
D:\Java>javac UseAnimals.java
UseAnimals.java:19: useAnimals(Horse) in UseAnimals cannot be applied to (Animal
)
ua.useAnimals(animalRefToHorse);
^
1 error

D:\Java>
 
Paul Clapham
Sheriff
Pie
Posts: 20185
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I expect that's because you misspelled the method name in line 6 of your posted code.
 
Srinivas Palam
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic