In this tutorial, we will see how to write the given float value into float buffer at the given index.
FloatBuffer API:
The java.nio.FloatBuffer class extends java.nio.Buffer class. It provides the following methods:
| Return type | Method | Description |
| static FloatBuffer | allocate(int capacity) | The allocate(..) method allocate a new float buffer. |
| abstract FloatBuffer | put(int index, float f) | The put(..) method write the given float value into associated buffer at given index. |
| abstract float | get(int index) | The get(...) method returns float value at given index. |
import java.nio.*;
|
| C:\>java PutIndexValue Store value at index : 3 22.45 |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.