Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
You think you know me .... You will never know me ... You know only what I let you know ... You are just a puppet ... --CMG
For that reason, a question like this has no place whatsoever in a Java exam, including practice exams. The Java language specification and public APIs do not specify the answer to this question. Dan is spot on: this is not a Java question, it's an implementation trivia question which has one answer for Sun J2SE 1.4, but might well have another answer for, say, the IBM JDK, or Sun J2SE 1.5. You can't even appeal to "common sense", as you could easily imagine an optimised Byte.toString() that uses 256 string constants.Originally posted by Dan Chisholm:
The answer is false, because the existing implementation of Byte.toString will cause a new String to be created each time Byte.toString is invoked. [my emphasis - PdH]
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
I've heard it takes forever to grow a woman from the ground
AspectJ, an asepct-oriented extension to Java programming language.<br /><a href="http://www.aspectj.org" target="_blank" rel="nofollow">http://www.aspectj.org</a>
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|