Hi All,
Looking at the following two links
http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#15722
http://rmathew.blogspot.com/2007/01/local-variables-in-java.html
It says that all local variables are stored within a fixed-size array and as the first link points out "A single local variable can hold a value of type boolean, byte, char, short, int, float, reference, or returnAddress. A pair of local variables can hold a value of type long or double."
My doubt then this means you do not need to use StringBuilders right? because even if you use a normal
String and keep appending to it, as long as its memory scope is "local" it will only use a single array space isnt it? Ofcourse there is still the String pool space which will grow but as far as concatenating is conerned it will always only be within a single frame ( which is the method call as explained in the first link) and it will be removed from space as soon as the method returns. Any thoughts on this would be much appreciated.
Regards,
Dinuka Arseculeratne
if who i am is what i have, and what i have is lost, then who am i?<br /> <br />SCJP 5.0<br />SCWCD 1.4<br />SCBCD preparing