- Java.lang - Void
- Java.lang - Throwable
- Java.lang - ThreadLocal
- Java.lang - ThreadGroup
- Java.lang - Thread
- Java.lang - System
- Java.lang - StringBuilder
- Java.lang - StringBuffer
- Java.lang - String
- Java.lang - StrictMath
- Java.lang - StackTraceElement
- Java.lang - Short
- Java.lang - SecurityManager
- Java.lang - RuntimePermission
- Java.lang - Runtime
- Java.lang - ProcessBuilder
- Java.lang - Process
- Java.lang - Package
- Java.lang - Object
- Java.lang - Number
- Java.lang - Math
- Java.lang - Long
- Java.lang - Integer
- Java.lang - InheritableThreadLocal
- Java.lang - Float
- Java.lang - Enum
- Java.lang - Double
- Java.lang - Compiler
- Java.lang - ClassLoader
- Java.lang - Class
- Java.lang - Character.UnicodeBlock
- Java.lang - Character.Subset
- Java.lang - Character
- Java.lang - Byte
- Java.lang - Boolean
- Java.lang - Home
Java.lang Package extras
Java.lang Package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java StringBuffer Class
The Java StringBuffer class is mutable sequence of characters. This provides an API compatible with StringBuilder, but with no guarantee of synchronization.
Class methods
Following is the pst of built-in functions available in this class −
Sr.No. | Method & Description |
---|---|
1 | This method appends the given string argument to the sequence. |
2 | This method appends the string representation of the codePoint argument to this sequence. |
3 | This method returns the current capacity. |
4 | This method returns the char value in this sequence at the specified index. |
5 | The Java StringBuffer chars() method is used to map a StringBuffer to a stream of int zero-extending char values. |
6 | This method returns the character (Unicode code point) at the specified index. |
7 | This method returns the character (Unicode code point) before the specified index. |
8 | This method returns the number of Unicode code points in the specified text range of this sequence. |
9 | This method is used to return the Unicode values representing the current object. |
10 | This method compares two StringBuffer instances in a lexicographical manner. |
11 | This method removes the characters in a substring of this sequence. |
12 | This method removes the char at the specified position in this sequence. |
13 | This method ensures that the capacity is at least equal to the specified minimum. |
14 | Characters are copied from this sequence into the destination character array dst. |
15 | This method returns the index within this string of the first occurrence of the specified substring. |
16 | This method inserts the string representation of the given argument into this sequence. |
17 | This method returns the index within this string of the rightmost occurrence of the specified value. |
18 | This method returns the length (character count). |
19 | This method returns the index within this sequence that is offset from the given index by codePointOffset code points. |
20 | This method replaces the characters in a substring of this sequence with characters in the specified String. |
21 | This method causes this character sequence to be replaced by the reverse of the sequence. |
22 | Character at the specified index is set to ch. |
23 | This method sets the length of the character sequence. |
24 | This method returns a new character sequence that is a subsequence of this sequence. |
25 | This method returns a new String that contains a subsequence of characters currently contained in this character sequence. |
26 | This method returns a string representing the data in this sequence. |
27 | This method attempts to reduce storage used for the character sequence. |