• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Difference between Class Loading and Class Initialization ?

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 76447
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 76447
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome but I didn't do the work: it was SL.
 
Trust God, but always tether your camel... to this tiny ad.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic