Loading a class twice in JVM using different loaders

后端 未结 3 529
悲哀的现实
悲哀的现实 2021-01-01 02:36

I have one question regarding concepts of class loading. How to load a .class file twice in JVM. I am also writing an excerpt of code that I have written to accomplish this.

3条回答
  •  隐瞒了意图╮
    2021-01-01 02:59

    In both cases you are using the same ClassLoader to perform the loading. You have two ClassLoaders but each just call super.loadClass() which delegates to the same parent ClassLoader which is AppClassLoader.

提交回复
热议问题