Home Tutorial Java Corejava Nio Get the capacity of a double type buffer

 
 

Get the capacity of a double type buffer
Posted on: July 28, 2010 at 12:00 AM
In this tutorial we will see how to get the capacity of a double type buffer

Get the capacity of a double buffer

In this tutorial we will see how to get size of a double buffer using capacity() method.

Code:

import java.nio.DoubleBuffer;

public class DoubleBufferDemo {
  public static void main(String[] args) {
    DoubleBuffer doublebuffer = DoubleBuffer.allocate(6);
    doublebuffer.put(324.242).put(3534.3432).put(85.342).put(454.453).put(
        354.3424).put(4334.343);
    System.out.println(doublebuffer.capacity());
  }
}

Output:

  6

Download this code

Related Tags for Get the capacity of a double type buffer:


Ask Questions?

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.