More JAVA Programs
Collections in JAVA
Applet Programming in JAVA
StringBuffer Class in JAVA
Strings in JAVA can also be made by making an object of the StringBuffer Class.
So why do we use the StringBuffer Class?
StringBuffer Class is mutable while String Class is immutable, hence we can modify the string using the StringBuffer Class.
|length()||Returns an integer value equal to length of the String|
|capacity()||Returns the current capacity of the StringBuffer object|
|charAt(int)||Returns the character at the index passed to this method in the brackets|
|setCharAt(int, char)||Character passed is set at the index specified in the brackets|
|append(String)||Appends the string passed to the original string|
|insert(int, char)||Inserts character passed at the specified index|
|delete(int, int)||Deletes the substring from starting to ending indices passed to this method|
|replace(int, int, String)||Replaces the string passed into the original string from the starting to ending indices passed to the method.|
|reverse()||Reverses the original string|
|toString()||Converts string buffer data into a string|