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

K&B book looks to me that it is an error

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
K&B pg 355
the fig for step 3 shud show the object with the value "def" on the heap
although no object is reffering to it.
Pg 356
the fig for step 2 shud show the object with the value "Rules!" on the heap
although no object is reffering to it.
Pg 358
the fig for step 2 shud show the object with the value "Rules!" on the heap
although no object is reffering to it.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's because they're not on the heap but in the string pool.
So there's no error on these pages.
 
Mohit Goyal
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the other steps in the figure also involve strings in the pool as no new keyword is used
 
Mohit Goyal
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found another one
K&B pg 380 table 6.3 cont.
Classes Boolean & Character also have an overloaded static toString method that take the respective primitive
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mohit Goyal:
K&B pg 355
the fig for step 3 shud show the object with the value "def" on the heap
although no object is reffering to it.


String s = "abc";
String s2 = s;
s = s.concat("def");


I agree with Mohit. It seems "def" is missing on the Fig6-1 (as well as "Rules" missing on Fig6-2,Fig6-3) since it is also another String object created.
[ December 02, 2003: Message edited by: sherry cuenco ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does this book have an errata anywhere ?
Edwin
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Edwin Davidson:
does this book have an errata anywhere ?
Edwin


hello
Errata for this book could be found wickedlysmart.com
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic