-1

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?

arshajii
  • 127,459
  • 24
  • 238
  • 287
Amar
  • 755
  • 2
  • 16
  • 36
  • Try to access the static variables. You'll then know if they are initialized properly. – Sotirios Delimanolis Aug 14 '13 at 19:15
  • Can you please google around a bit regarding Class Loading and gain some knowledge and then come up with some concrete doubts? – Arham Aug 14 '13 at 19:15
  • Please post your relevant code along with a clear description of the problem you are encountering, and the steps you have taken to try and resolve it. – Jason C Aug 14 '13 at 19:32
  • Out of flags, possible duplicate of http://stackoverflow.com/questions/1761377/in-what-order-are-the-different-parts-of-a-class-initialized-when-a-class-is-loa?rq=1 – Jason C Aug 14 '13 at 19:36

1 Answers1

0

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.

Jason C
  • 38,729
  • 14
  • 126
  • 182