Does system classloader load all classes in classpath even if they're not actually used?

前端 未结 3 1688
难免孤独
难免孤独 2021-01-22 13:57

I\'m using JDK 1.6 to run a small application. However I set a very massive classpath which includes a lot of classes.

When I run the application will all classes in the

3条回答
  •  失恋的感觉
    2021-01-22 14:35

    To my knowledge it's impossible to load all classes if they are not accessed explicitly. Class in only loaded when it's constructor or any other static member is first accessed, this rule applies to nested classes as well.

提交回复
热议问题