Originally posted by Michael Pearson:
Since StringBuffers are mutable appending does not create new Objects.
[ April 08, 2002: Message edited by: Michael Pearson ]
Originally posted by Michael Matola:
Now here's a question:
But what if the destination array isn't big enough? Within Java code, arrays aren't resizable, right? So does arraycopy() have the ability to behind-the-scenes increase the size of an array, or is it creating a new char array whenever the destination array isn't big enough?
Originally posted by Marilyn deQueiroz:
How many Objects are created here?
A StringBuffer object is created and within that a char object. Then a String object
is created and within that a char object.
This looks like one of those certification questions.[/QB]
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-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton