File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Class loads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Class loads" Watch "Class loads" New topic
Author

Class loads

James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

I have read that the value to instance varible are assigned when the class is loaded. The staic blocks are executed when the class is loaded...
So my question , what is the mean of "class loading"?
When does this actually happen. What are the sequence of steps that happen during loading ?
Hope my question is clear.


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Instance variables are initialized when instance of the class is created.
The static block is executed when the class is loaded by the JVM.
Loading the class means Class Loader Application loads the class over the
memory to be used.


Go through Class Loader, Dynamic Class Loading, in "Thinking In Java", By
Bruce Eckel. He has described in really very good way.


cmbhatt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class loads
 
Similar Threads
What does Class.forName() do ?
class loading
Class.forName() ?
static block
Static and Dynamic class loading