such as the Object finalize method , where the compiler or the JVM to achieve it ?
How can I see the path his specific implementation code ? ? ?
------ Solution ---------------------------------------- ----
Object 's finalize originally empty
subclasses need to override it
------ Solution --------------------------- -----------------
protected void finalize () throws Throwable {}
Object in the full realization that such an empty method . . . Nothing really fantastic stuff in it it
------ Solution ------------------------------------ --------
Object inside finalize method is just a signature , there is no realization of the need to implement a subclass
------ For reference only -------- -------------------------------
jdk you download the source code with eclipse import ; to him is how you will be able to achieve the java source code is open source, you are able to download the source code to see .
------ For reference only -------------------------------------- -
Java not have direct access to the underlying operating system ( such as system hardware, etc. ) , for Java to use Java native methods to expand the functionality of the program , such as native method can be likened to a Java program with C program interface.
------ For reference only -------------------------------------- -
This is the Object finalize method source code:
protected void finalize () throws Throwable {}
empty, in which it achieved ? ? ?
------ For reference only -------------------------------------- -
rewrite general is super.finalize ();
This implementation where ? ? ?
------ For reference only -------------------------------------- -
native methods are using C / C + + inside the virtual machine to achieve , want to see source code ? Possible? If all you see oracle source , and he was due to go home.
没有评论:
发表评论