Java – the difference between loadclass (string name) and loadclass (string name, Boolean resolve)
•
Java
What is the difference between loadclass (string name) and loadclass (string name, Boolean resolve)?
The only difference I know is loadclass (string name, Boolean resolve). If the resolve parameter is true, call findloadedclass (string)?
So when true or false is passed to the parsing parameter? I'm confused about these two functions
thank you.
Solution
The resolve parameter controls whether the loaded class is linked During linking, static constants are initialized and their memory allocated In addition, the correctness of the class is verified, and links to other classes may be resolved
This can be useful, for example, if you want to load a new class that may be malformed and you don't want the JVM to throw validation errors in case of class errors
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码