Writes the given double value into a buffer at the given index.


 

Writes the given double value into a buffer at the given index.

In this tutorial you will see how to write the given double into buffer at the given index.

In this tutorial you will see how to write the given double into buffer at the given index.

Writes the given double value into a buffer at the given index.

In this tutorial you will see how to write the given double into buffer at the given index. The put (int index, double d) allow to write a character at particular index. It also allow to overwrite the content of the buffer which can be seen in this example.

Code:

import java.nio.DoubleBuffer;

public class DoubleBufferDemo {
  public static void main(String[] argvthrows Exception {
    DoubleBuffer buffer = DoubleBuffer.allocate(8);
    buffer.put(44.23).put(43.53).put(65.343);
    buffer.put(111.111);
    buffer.put(3675.434).put(4243.533);
    System.out.println(buffer.get(1));
  }
}

Output:

  11.111

Download this code

Ads