• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
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
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic