Hi Folks,
I have doubt in the classpath.
i have the same class files (even with package structure) in 3
jar files and i have added all the three jar files in my classpath.
Can you please send me reply my question.
Q1) When i import the class files in my program which loaded
into my program.
Bart Cremers - 08 May 2006 07:36 GMT
This depends a bit on the way the classloader is implemented. If you've
got the same class in different jar files, the classloader normally
will load the first class with the exact fully qualified name it finds.
The standard classloader will normally go through the classpath in
order it is defined. So the first jar containing the class in the
classpath will provide the class. The other jars will simply be
ignored.
Again, this depends on the implementation of the classloader. Remember
that classloaders are not required to take the classpath into account
when loading classes.
Bart
ramakrishna - 08 May 2006 09:11 GMT