Java FloatBuffer.put(float f)
Syntax
FloatBuffer.put(float f) has the following syntax.
public abstract FloatBuffer put(float f)
Example
In the following code shows how to use FloatBuffer.put(float f) method.
import java.nio.FloatBuffer;
import java.util.Arrays;
/*w ww. j a v a 2 s . c o m*/
public class Main {
public static void main(String[] args) {
FloatBuffer floatBuffer = FloatBuffer.allocate(10);
floatBuffer.put(1.23F);
System.out.println(Arrays.toString(floatBuffer.array()));
}
}
The code above generates the following result.