Java IO Tutorial - Java FloatBuffer.toString()








Syntax

FloatBuffer.toString() has the following syntax.

public String toString()

Example

In the following code shows how to use FloatBuffer.toString() method.

import java.nio.FloatBuffer;
/* ww  w  .j a v  a  2 s .com*/
public class Main {
  public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);
    
    floatBuffer.put(1,1.23F);
    
    System.out.println(floatBuffer.toString());

  }
}

The code above generates the following result.