top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How does Java ClassLoader work?

0 votes
292 views
How does Java ClassLoader work?
posted Feb 11, 2018 by Gn Guruswamy

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When JVM requests for a class, it invokes loadClass function of the ClassLoader by passing the fully classified name of the Class.
loadClass function calls for findLoadedClass() method to check that the class has been already loaded or not. It’s required to avoid loading the class multiple times.
If the Class is not already loaded then it will delegate the request to parent ClassLoader to load the class.
If the parent ClassLoader is not finding the Class then it will invoke findClass() method to look for the classes in the file system.

answer Feb 12, 2018 by Jon Deck
...