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
Advertisement
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

Advertisement

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


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 28, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com