what class loader is used?

Viewed 1917

I have several questions regarding to class loaders.

Class.forName("class.name");

and

....
NotYetLoadedClass cls = new NotYetLoadedClass();
.....

What class loaders will be used in each case? For the first case I assume class loader that was used to load class in which method code is executing. And in the second case I assume thread context class loader.

In case I am wrong, a small explanation is appreciated.

1 Answers
Related