Search code examples
javaclassloader

Components of class loading


I want to know how class loading is done in Java.
Also, I want to know what are the components that are loaded at the time of class loading.

Because I have a class, I am initializing some of the variables in a static way and I need to know if those are initialized properly or not.

Is there any stack trace kind of functionality available to see the components for a class at the time of class loading?


Solution

  • I want to know how class loading is done in Java. Also, I want to know what are the components that are loaded at the time of class loading.

    See:

    Because I have a class, I am initializing some of the variables in a static way and I need to know if those are initialized properly or not.

    See above. In addition, if you are not initializing them properly, that is also an issue.

    Is there any stack trace kind of functionality available to see the components for a class at the time of class loading?

    You could add System.out.println() or other logging output to trace things that you are interested in.