StringBuilder Vs StringBuffer
StringBuffer is synchronized, StringBuilder is not.
Both are mutable
The object created through StringBuffer & StringBuilder are stored in the heap .
StringBuffer is slow but thread safe . Due to this it does not allow two threads to simultaneously access the same method . Each method can be accessed by one thread at a time .
StringBuilder is fast as it is not thread safe.
Adding variable watch
While you're in the debugger go Window -> Debugger -> Variables
You will have <Enter new watch> written there. Type the variable you want to watch there and you can track it from there.
No comments:
Post a Comment