Loops don't present any special performance issues other than that the code inside of them will be executed more than once. If the loop will run 3 or 10 or 20 times, it hardly matters. If a loop is going to run a million times, then it can be worth the effort to squeeze every possible object instantiation -- explicit or implicit -- outside of the loop.
If you tell us what kind of code you're talking about, we might have some more specific advice.
If what you need is 10,000 Strings that consist of two components, then you don't have much choice, really, other than using a StringBuffer (actually, in new code, Java 5's StringBuilder is a better choice, but the APIs are identical). You could use a char and do the moral equivalent of append() yourself, but it would be unlikely to be worth the effort.
But if you're doing something further with 'color', such that you don't really need it as a String itself -- for example, just printing it -- then it would be better to avoid the StringBuffer here.
So I guess I'm saying that we still need more information to give a really good answer.
without any performance impact. The compiler will translate that to using a StringBuilder/Buffer, anyway.
Using StringBuilder only starts to pay back when you append *to the same string* *in more than one statement*, i.e. while looping.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus