Sunday 2 April 2017

Why java.lang.Object class methods are native?

These are some methods in java.lang.Object class, I was going through...



 protected native Object clone() throws CloneNotSupportedException;

public final native Class getClass();

public native int hashCode();

public final native void notify();

private static native void registerNatives();

public final native void wait(long timeout) throws InterruptedException;


why are these methods define as native? Please share reference and further reading docs if possible.



Source : java.lang.Object

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...