This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

doubt about constructors (Java OCA 8 Programmer I Study Guide, Sybex)  RSS feed

 
Greenhorn
Posts: 11
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

In reference to the OCA JAVA SE8 Programmer I Guide by Jeanne Boyarsky & Scott Selikoff

In Chapter 5 (Class Design),  Question 2 of Review Questions:




When I execute this code, the output is:  Mammal
where as in the answer explanation it says  Compilation Error (option E).

So is the answer in the book is wrong? Is so what about the answer explanation ?
 
Sheriff
Posts: 11604
178
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ss Sharma wrote:So is the answer in the book is wrong? Is so what about the answer explanation ?


It is very important to have a great eye for detail when you try to run the code snippets yourself. I think (actually I am 100% sure) the code snippet you are using is different from the one in the study guide. That's why you can compile the code snippet, but the book claims a compiler error wil be given. So you should revise your code snippet very carefully with the one listed in the book, make the necessary changes and try to compile the code snippet again.
In this topic you'll find an explanation about the same code snippet. Definitely worth reading as well!

Hope it helps!
Kind regards,
Roel
 
shivika sharma
Greenhorn
Posts: 11
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I found my error.
Thanks for correcting!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!