What are the scenarios in which case a new class will be loaded?

Posted by GK on Stack Overflow See other posts from Stack Overflow or by GK
Published on 2010-03-18T19:09:38Z Indexed on 2010/03/18 19:11 UTC
Read the original article Hit count: 130

Filed under:

That is when you have any jar file attached to you your class path. then as far as i know any class from the jar is loaded for the first time when,

  1. when you create any object of that type. or
  2. If you are accessing any static member or method of that class. or
  3. when you load that by using Class.forName() method.

So are there any other ways of loading a class for the first time?

© Stack Overflow or respective owner

Related posts about java