• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Page 419 of K&B SCJP 5 - Number of String objects

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm reading the SCJP 5 study guide. On page 419 the number of String objects is listed as 8 and this does not include the " " (space String object) that is part of the System.out.println statement.

I checked the errata https://coderanch.com/t/257589/java-programmer-SCJP/certification/SCJP-Errata-Updated , but page 419 is not on the errata.

Should it be 9 String objects? Or is the space String " " inside the System.out.println object not created on the heap?

Please let me know.
 
Rashmi Jaik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh I'm wrong. The text says "how many String objects ... PRIOR ... to the println statement... ?"

8 String objects is CORRECT.

1) "spring " ,
2) "summer ",
3) "spring summer ",
4) "fall ",
5) "spring fall " ,
6) "spring summer spring",
7) "winter ",
8) "spring winter" ,
The above are before the println statment

The following are after println
9) " ",
10) "spring winter spring summer"
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic