Have a look at the Java class StringBuilder.

I beleive this will help you with what you are trying to achive.

When you have created an instance of StringBuilder use the append method to append...