When calling loadClass()
on a ClassLoader, does the ClassLoader
first check if the class has been loaded, or does it immediately delegate this check to
The two statements are not exactly mutually exclusive. The Class will only exist in the current ClassLoader's set of loaded classes if the parent ClassLoader had previously failed to find the Class. So,
When requested to find (the external data that describes) a class or resource, a ClassLoader instance will delegate the search for (the external data that describes) the class or resource to its parent class loader before attempting to find (the external data that describes) the class or resource itself.
Which does not prevent it from short-circuiting if it knows its parent can't find the class but it can (as shown by it previously loading the class)