StringBuilder.insert(int offset, int i) has the following syntax.
public StringBuilder insert(int offset, int i)
In the following code shows how to use StringBuilder.insert(int offset, int i) method.
//from w ww.ja v a2 s . c om public class Main { public static void main(String args[]) { StringBuffer buffer = new StringBuffer(); int integerValue = 7; buffer.insert(0, integerValue); System.out.println(buffer.toString()); } }
The code above generates the following result.