Java Object class Analysis

Source: Internet
Author: User


private static native voidregisternatives(); static{
    registernatives ();
}
The associated C function, similar to the C function, is imported into Guolai so that you can call the C function, and the main import function isStatic Jninativemethod methods[] = {
{"Hashcode", "() I", (void *) &jvm_ihashcode},
{"Wait", "(J) V", (void *) &jvm_monitorwait},
{"Notify", "() V", (void *) &jvm_monitornotify},
{"Notifyall", "() V", (void *) &jvm_monitornotifyall},
{"Clone", "() Ljava/lang/object;", (void *) &JVM_Clone},}; So when these methods are called, they are actually called C functions
hashcode ();
According to the Java contract specification, each object should have a hashcode value, mainly used to support the hash table, you can consider this problem, how to ensure that the hash value of each objects close to non-repetition

Cloneclonenotsupportedexception;
By convention, this method is to return a copy of an object, which is equivalent to re-copying the object in memory, to study the depth of the copy.
Finalizethrowable {}

The Java garbage collection mechanism specifies the method that must be called before an object is destroyed.
some of the other methods are primarily thread-related
in summary, the Object class is primarily a basic implementation of Java Conventions


Java Object class Analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.