• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Class loads

 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic