What is a Java ClassLoader?

前端 未结 7 1996
眼角桃花
眼角桃花 2020-11-29 14:24

In a few simple sentences, what is a Java ClassLoader, when is it used and why?

OK, I read a wiki article. ClassLoader loads classes. OK. So if I include jar files a

7条回答
  •  时光取名叫无心
    2020-11-29 15:05

    Class Loaders are a functional component of JVM, which loads class data from the '.class' file or from over the network in to the Method Area in Heap.

    Looks like a integral part of the JVM, but as an end java user why should I be concerned? Here is why:

    Each class loader has it's own name space and classes invoked by a particular class loader gets into it's name space.

    Classes invoked by two different class loaders will not have visibility over each other, resulting in enhanced security.

    Class loader parent child delegation mechanism ensures java api classes could never be hacked by unauthorized code.

    For details look here

提交回复
热议问题