• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SCJP 1.6 book from Kathy Sierra mistakes (Printing or anyother)

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found some mistakes in Kathy Sierra SCJP 1.6 book. i don't know were they printing mistakes or not. and please correct me if i am wrong because i am preparing for SCJP exam.

1. Page 458(Chapter 6) there is a line of code like:

name = c.readLine("%s", "input?: "); //#4 return a String

Here "name" variable is not declared it should be like " String name = c.readLine("%s", "input?: ");


2. Page 533(Question no 8): answer says option C(10 0 10) is correct but i think option b(10 0 9) is correct. bec variable z is declared as transient and before we store other variable to file its value was 10 and when we read object back then its value must be reset to 9. not 10. correct me if i am wrong.


I am still reading the book and if i found anymore mistakes i will post it here if any one else found problems like above please post here. so we we all can correct it.
 
Ranch Hand
Posts: 710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lokendra Shekhawat wrote:i found some mistakes in Kathy Sierra SCJP 1.6 book. i don't know were they printing mistakes or not. and please correct me if i am wrong because i am preparing for SCJP exam.

1. Page 458(Chapter 6) there is a line of code like:

name = c.readLine("%s", "input?: "); //#4 return a String

Here "name" variable is not declared it should be like " String name = c.readLine("%s", "input?: ");


2. Page 533(Question no 8): answer says option C(10 0 10) is correct but i think option b(10 0 9) is correct. bec variable z is declared as transient and before we store other variable to file its value was 10 and when we read object back then its value must be reset to 9. not 10. correct me if i am wrong.


I am still reading the book and if i found anymore mistakes i will post it here if any one else found problems like above please post here. so we we all can correct it.



I believe there is already a topic for errata in the Sierra & Bates study guide.
 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh!! sorry for that will you please guide me to that thread please
 
W. Joe Smith
Ranch Hand
Posts: 710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lokendra Shekhawat wrote:oh!! sorry for that will you please guide me to that thread please



It is a link at the top of the SCJP forum, but it states it is for Java 5. I don't know if there is one specifically for 6 yet.

Teaches me to not research my answer before I post!
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

2. Page 533(Question no 8): answer says option C(10 0 10) is correct but i think option b(10 0 9) is correct. bec variable z is declared as transient and before we store other variable to file its value was 10 and when we read object back then its value must be reset to 9. not 10. correct me if i am wrong.


In my K&B book variable z declared as static, and y as transient, the last number printed is z, so I believe 10 is correct answer in this case
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alexander Danilou wrote:

2. Page 533(Question no 8): answer says option C(10 0 10) is correct but i think option b(10 0 9) is correct. bec variable z is declared as transient and before we store other variable to file its value was 10 and when we read object back then its value must be reset to 9. not 10. correct me if i am wrong.


In my K&B book variable z declared as static, and y as transient, the last number printed is z, so I believe 10 is correct answer in this case



me too, I have z declared as static and y as transient.
 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my mistake the second one is correct bec variable z is static and it will have value 10 the whole time the class exists. so second one is correct. my mistake
 
reply
    Bookmark Topic Watch Topic
  • New Topic