aspose file tools*
The moose likes Java in General and the fly likes Dynamic class loading and lazy loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Dynamic class loading and lazy loading" Watch "Dynamic class loading and lazy loading" New topic
Author

Dynamic class loading and lazy loading

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
Is there any difference between lazy loading and dynamic class loading ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Definitely. Lazy loading means that you postpone loading until you need it. Dynamic class loading means you don't know the name of the class until runtime. Lazy loading can apply to both dynamic and non-dynamic class loading. (In fact, the JVM uses lazy loading all the time, also for the classes from the core API.)


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Moguluri Ravi Kiran
Ranch Hand

Joined: Apr 16, 2010
Posts: 62

I did not know Dynamic & Lazy class loading.
Please explain me with Suitable example.

Kiran.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
Do you really mean, "What is the difference between lazy ***** and eager *****?"
jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
I too wanted an example of dynamic class loading and lazy class loading
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

Dynamic loading:

Lazy loading:
jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
Does this mean that lazy loading applied only to static methods ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

No, it applies to classes. The thing is that classes are usually loaded when they are needed, and they are only needed when a static method or field is accessed or an instance of the class is created.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic class loading and lazy loading