LongBuffer getClass() in Java

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

Syntax:

Class<? extends LongBuffer> 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.LongBuffer;

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

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

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

Output:

class java.nio.HeapLongBuffer


No comments:

Post a Comment