StringBuffer methods in java: As we know that StringBuffer and StringBuilder are mutable where you can edit / modify without creating the new String object /instance. StringBuffer and StringBuilder provides different methods to be done on String. The methods in StringBuffer and StringBuilder are similiar the only difference is StringBuffer is synchronized and thread safe where StringBuilder is non-synchronized and it is not thread safe. See the Difference between StringBuffer and StringBuilder Syntax: int length() int capacity() void ensureCapacity(int MinimumCapacity) void trimToSize() void setLength(int length) char charAt(int index) int codePointAt(int index) int codePointBefore(int index) int codePointCount(int Beginindex, int Endindex) int offsetByCodePoints(int index, int offsetcodepoint) void getChars(int srcBegin, int srcEnd, char[], int destinationBeginindex) void setCharAt(int index, char ch) StringBuffer delete(int beginIndex, int endIndex) StringBuff...
Comments
Post a Comment