Saturday 19 July 2014

StringBuilder Vs StringBuffer

  1. StringBuffer is synchronized, where as StringBuilder is not.
  2. In single threaded environment, prefer StringBuilder, since it is faster than StringBuffer because it's not synchronized
  3. If your data is going to change by multiple threads, then StringBuffer is preferable.

                                                             Home

No comments:

Post a Comment