Java Data Type Tutorial - Java StringBuilder.insert(int offset, boolean b)








Syntax

StringBuilder.insert(int offset, boolean b) has the following syntax.

public StringBuilder insert(int offset,   boolean b)

Example

In the following code shows how to use StringBuilder.insert(int offset, boolean b) method.

public class Main {
  public static void main(String args[]) {
    StringBuilder buffer = new StringBuilder();
// w  w w .  j  a  va 2s . c o  m

    
    boolean booleanValue = true;
    buffer.insert(0, booleanValue);


    System.out.println(buffer.toString());
    
  }
}

The code above generates the following result.