This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Consider the following code snippet from K&B (Chapter 6)
The book says - There were a total of eight String objects created as follows: "spring", "summer " (lost), "spring summer", "fall" (lost), "spring fall" (lost), "spring summer spring" (lost), "winter" (lost), "spring winter" (at this point "spring" is lost).
My Question is - Why are we missing an string ( which is embedded in print statement, i.e., " ") while counting the number of string objects? This *SPACE* string ( " " ) is also an string objects created in string pool. so the number of string object created should be 9. Please confirm!
Thanks! [ February 08, 2007: Message edited by: Barry Gaunt ]