Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Programmer Certification (OCPJP)
SCJP 6 study guide page 107 (Overridden Methods)
Rolf Lorenz
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
On page 107 of Sierra and Bates study guide there is written, that the comand in line 4 is "not legal because Horse didn't inherit eat()".
For me, everything is fine. When I am running the code, on the console is written:
Generic Animal Eating Generically
That's the code:
public class TestAnimals { public static void main(String[] args) { Horse h = new Horse(); h.eat(); // really not legal? } } class Animal { public void eat() { System.out.println("Generic Animal Eating Generically"); } } class Horse extends Animal { }
I think, the authors expected an error messaage. Is there an error in the book or in my code?
John Sutt
Ranch Hand
Posts: 42
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You made the eat() method public
SCJP 6 (91%), SCJD (91%)
Rolf Lorenz
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
oh yes, now it works.
thank you John
chandra sekar
Greenhorn
Posts: 9
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi everyone
i am preparing for
scjp
exam. please give me study guides for scjp6.0.
also please guide me how to prepare for the exam. please help me.
it is urgent
Rolf Lorenz
Greenhorn
Posts: 4
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi chandra!
I am using the book SCJP 6 by Kathy Sierra and Bert Bates. Up to now (I am still on page 107) I am content with my choice.
I chose SCJP 6, because, the authors were lead developers for the exam.
Rolf
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
preparing for SCJP 5
Super class and subclass access methods
Polymorphism in Overloaded and Overridden Methods
OverRiding a private method
overriding
More...