Any explanation? Am i missing something obvious in the above code?
Interesting.... give me a sec.
Wow, you are right. StringBuffer is faster.... hmmmm.... give me another sec.
Okay, it looks like you are being interferred with (Probably by the JIT). Place your test code within a loop, and run it many times. You will noticed that StringBuffer is only faster for only the first iteration.
Once the program warms up, which is within a second, StringBuilder is faster.
Henry