|
Java™ by example!
|
|
|
How does StringBuiler compare with StringBuffer in JDK 1.5?
StringBuilder is a replacement for the thread-safe StringBuffer class. It works much faster as it has no synchronized methods. So, if you are doing lots of String operations in a single thread, you will gain a lot of performance when using this class. Here's a comparison. Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|