Java StringBuilder.insert(int offset, float f)
Syntax
StringBuilder.insert(int offset, float f) has the following syntax.
public StringBuilder insert(int offset, float f)
Example
In the following code shows how to use StringBuilder.insert(int offset, float f) method.
public class Main {
public static void main(String args[]) {
StringBuilder buffer = new StringBuilder();
//ww w . j a v a2 s . co m
float floatValue = 2.5f;
buffer.insert(0, floatValue);
System.out.println(buffer.toString());
}
}
The code above generates the following result.