• 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

dynamic class loading

 
Ranch Hand
Posts: 203
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

What is dynamic class loading in java, please ..if you can show a small example in which we are dynamically loading a class..!! that will be a great help...!!
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every single class you use is loaded dynamically.

If you want a more detailed answer, you'll have to provide some context.
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:Every single class you use is loaded dynamically.

If you want a more detailed answer, you'll have to provide some context.



well if I made a simple class A with system.out.println statement in it...so how does it get dynamically loaded ..please explain in detail what steps go at back end, what instruction does compiler run...? how it is different from class.forname()...? that will be a great help..!! thanks
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saral Saxena wrote:

Jeff Verdegan wrote:Every single class you use is loaded dynamically.

If you want a more detailed answer, you'll have to provide some context.



well if I made a simple class A with system.out.println statement in it...so how does it get dynamically loaded ..please explain in detail what steps go at back end, what instruction does compiler run...? how it is different from class.forname()...? that will be a great help..!! thanks



The compiler doesn't run any instructions. The JVM does.

If you want to know the general process of class loading, do a web search. I'm sure you'll find plenty. You can also look at the relevant sections of the JLS and JVM spec.
http://docs.oracle.com/javase/specs/jls/se5.0/html/j3TOC.html
http://docs.oracle.com/javase/specs/jvms/se5.0/html/VMSpecTOC.doc.html

After you've spent some time with that research, if you have a more specific question, by all means, ask it here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic