• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Class Loading and Class Initialization ?  RSS feed

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can any body please tell me what is the Difference between Loading a class and initializing a class..?

Thanks and Regards,
Lokesh
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lokesh,

I found an article on Developer.com that puts this pretty simply. Initialization is the process of executing the static initializers of a class, where class loading is the process of loading the class so that its bytecodes can be processed by the execution engine of the JVM (this is done at the beginning of the Java class life cycle). Classes are loaded either through the bootstrap class loader or through a user-defined/custom class loader.

The life cycle of a Java class includes loading, linking, initialization, and unloading, so loading must be performed before initialization (though this depends on JVM implementations).

HTH, and good luck!

Stacey
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Stacey Laurence and thank you for finding that article. It might help lokesh pattajoshi if you posted a link to it.
 
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is a link to an article about the subject -->link

or just type "Loading a class and initializing a class" in google.
 
Stacey Laurence
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that. The article above is also useful. Here's the one I cited: http://www.developer.com/java/other/article.php/2248831/Java-Class-Loading-The-Basics.htm
 
lokesh pattajoshi
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Laurence and Ritchie,

Thank you very much for your clear cut information which helped me a lot.

Regards,
Lokesh
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome but I didn't do the work: it was SL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!