IntBuffer getClass() in Java

getClass(): This method is available in java.lang.Object class of Java.

Syntax:

Class<? extends IntBuffer> java.lang.Object.getClass()

This method returns the runtime class of this Object. The returned Class object is the object that is locked by static synchronized methods of the represented class.

Parameters: NA

Returns: The Class object that represents the runtime class of this object.

Exceptions: NA

Approach

Java

import java.nio.IntBuffer;

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

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

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

Output:

class java.nio.HeapIntBuffer


No comments:

Post a Comment