What is the class loader in Java?

What does this mean when a customer says in Java that "code should not have a custom class loader"? What can't I do?

Solution

Class loader is an object in Java, which is responsible for finding binary representations of Java classes and loading them into the JVM All JVMs start with the boot class loader, which is responsible for loading the user's initial classes and some built-in types, such as class and securitymanager. However, users can provide their own class loader to find classes from other sources For example, a custom class loader can generate its own classes by writing its own bytecode, or find classes from networked sources

In order to meet customer requirements, you should not define your own class loader, but rely on the boot class loader to find all classes This is almost commonly done in simple java programs, because the use cases of custom boot loaders are often quite complex and nuanced Unless you specifically want to change how the JVM looks up and loads classes, you don't have to worry about this limitation

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
分享
二维码
< <上一篇
下一篇>>