Java StringBuffer.insert(int offset, float f)

Syntax

StringBuffer.insert(int offset, float f) has the following syntax.

public StringBuffer insert(int offset,   float f)

Example

In the following code shows how to use StringBuffer.insert(int offset, float f) method.


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


    float floatValue = 2.5f;
    buffer.insert(0, floatValue);

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

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable