Java – String vs StringBuffer
This article shows the difference in time taken for similar operations on a String object and StringBuffer object. String being an immutable class, it instantiates a new object each time an operation is performed on it StringBuffer being a mutable class, the overhead of object instantiation during operations is removed. Hence, the time taken for …