Home » Core Java » lang » StringBuffer

StringBuffer

Java StringBuffer Example

In this example we are going to present the StringBuffer class, which is contained in the java.lang package. We are going to show some of its most important uses and methods, and explain why and when it should be used, as well as the difference between StringBuffer and String. 1. String vs StringBuffer Strings in Java are immutable. This means that ...

Read More »

StringBuffer delete characters

With this example we are going to demonstrate how to delete characters using a StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain ...

Read More »

StringBuffer reverse method

This is an example of how to use the reverse method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. ...

Read More »

StringBuffer insert method

In this example we shall show you how to use insert method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method ...

Read More »

StringBuffer replace method

With this example we are going to demonstrate how to use replace method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain ...

Read More »

StringBuffer append method

This is an example of how to use append method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. Appending ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns