|
|
Home J2EE Concepts JMS Java Language Contact Back Next Bookmark this Page |
Some useful tips related to:
|
String Vs. StringBufferString is immutable, whereas StringBuffer is not! Operations performed on StringBuffer are much faster. Since String is immutable, therefore, any operations performed on String would lead to creation of new String variables in memory. StringBuffer is said to be thread safe. However, in my opinion it really doesn't matter because String is immutable, so it is not supposed to change; and if it is not supposed to change then there is no point in thinking over advantages of StringBuffer in terms of thread safety. |
|
|
|