A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Multiple loading of a class thru Class.forName() ??
Joined: May 08, 2006
Dec 11, 2006 01:51:00
Hello Ranchers ,
Does a class gets loaded twice in the memory if i call it twice in my code using Class.forName() ?
will this load the driver in the memory twice or do i have take care of it using a static block ?
Joined: Mar 06, 2001
Dec 11, 2006 02:50:00
The class will only be loaded once. As long as the second one asks the same ClassLoader to load the Class, nothing will happen. It is however possible for the class to be loaded if another ClassLoader is specified, but not guaranteed.
I agree. Here's the link:
subject: Multiple loading of a class thru Class.forName() ??
Getting exception while loading
Java Connectivity with MySQL5.1.22
Confusion in Class.forName() :confused:
Servlet doesn't show data
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014