Skip to content

Tag Archives: java-StringBuffer

The trimToSize() method of StringBuffer class is the inbuilt method used to trims the capacity used for the character sequence of StringBuffer object. If the… Read More
The codePointBefore() method of StringBuffer class is a method used to take an index as a parameter and returns the “Unicode number” of the character… Read More
The codePointCount() method of StringBuffer class is used to return the number of Unicode code points in the specified range of beginIndex to endIndex of… Read More
The subSequence(int start, int end) method of StringBuffer class is the inbuilt method used to return a subsequence of characters lie between index start and… Read More
The setLength(int newLength) method of StringBuffer class is the inbuilt method used to set the length of the character sequence equal to newLength. If the… Read More
The StringBuffer.replace() is the inbuilt method which is used to replace the characters in a substring of this sequence with the characters in the specified… Read More
Pre-requisite: StringBuffer class in Java The java.lang.StringBuffer.append() method is used to append the string representation of some argument to the sequence. There are 13 ways/forms… Read More
The java.lang.StringBuffer.delete() is an inbuilt method in Java which is used to remove or delete the characters in a substring of this sequence. The substring… Read More
appendCodePoint() method of StringBuffer class appends the string representation of the codePoint argument to this sequence for which we require pre-requisite knowledge of ASCII table… Read More
The Java.lang.StringBuffer.deleteCharAt() is a built-in Java method which removes the char at the specified position in this sequence. So that the sequence is reduced by… Read More
The Java.lang.StringBuffer.reverse() is an inbuilt method which is used to reverse the characters in the StringBuffer. The method causes this character sequence to be replaced… Read More
The StringBuffer.insert() method inserts the string representation of given data type at given position in a StringBuffer. Syntax: str.insert(int position, char x); str.insert(int position, boolean… Read More
Consider the following codes in java:   Java // This program prints false class GFG {     public static void main(String[] args) {     StringBuffer sb1 =… Read More
Predict the output of the program import java.util.Random; public class GFG {     private static Random rd = new Random();      public static void main(String[] args) {… Read More
Sorting a collection of objects can be done in two ways:  By implementing Comparable (Natural Order) e.g. Strings are sorted ASCIIbetically. meaning B comes before… Read More

Start Your Coding Journey Now!