If you use String concatenation in a loop, like
String str = "";
for (int i = 0; i < 50; i++)
{
str += ", " + i;
}
then StringBuilder is used (not StringBuffer) instead of a String because it is much faster and consumes less memory.
If you have a single statement,
String str = "1, " + "2, " + "3, " + "4," + "5, " ...;
then you can use Strings because the compiler will use StringBuilder automatically.