In java how can we use the concept of stringbuilder
1
Expert's answer
2014-12-15T00:50:38-0500
If you use Stringconcatenation in a loop (something like: String s =""; for(int i = 0; i <100; i++) { s += ", " + i; } then you should usea StringBuilder (not StringBuffer)instead of a String, because it is much faster and consumes less memory. If you have a singlestatement: String s = "1," + "2, " + "3, " + "4, " ....; then you can useStrings, because the compiler will use StringBuilder automatically.
It’s the most wonderful time of the year! There’ll be much hollying and jollying, but there will also be plenty…
APPROVED BY CLIENTS
The quality is good, i have lost only one mark in the assignment so it’s not bad, the prices is very high which really made me sad, the online chat was so helpful.
Thanks
Comments
Leave a comment