Java IO Tutorial - Java FloatBuffer.get(int index)








Syntax

FloatBuffer.get(int index) has the following syntax.

public abstract float get(int index)

Example

In the following code shows how to use FloatBuffer.get(int index) method.

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

  }
}

The code above generates the following result.