Richard Welty <rwelty@averillpark.net> writes:
> String query
> = "SELECT foo "
> + "FROM bar "
> + "WHERE baz = 'bletch';"
This particular expression is rewritten by the compiler to use
StringBuffer, so is equivalent to:
> StringBuffer query = new StringBuffer();
>
> query.append( "SELECT foo ");
> query.append( "FROM bar ");
> query.append( "WHERE baz = 'bletch';"
>
> return new String( query);
Maybe you are thinking in something like
String foo = ""
while(cond) {
foo += bar;
}
which is, indeed, quite inefficient.
Regards,
Manuel.