IntBuffer position() in Java

position(): This method is available in java.nio.IntBuffer class of Java.

Syntax:

int java.nio.Buffer.position()

This method returns this buffer's position.

Parameters: NA

Returns: The position of this buffer.

Exceptions: NA

Approach

Java

import java.nio.IntBuffer;

public class IntBufferposition {
    public static void main(String[] args) {

        int array[] = { 1, 2, 3, 4 };
        IntBuffer lb = IntBuffer.wrap(array);

        System.out.println(lb.position());
    }
}

Output:

0


No comments:

Post a Comment