2

I have two jars that have the same package structure. And they have a class that have the same name. like..

lib1.jar
   - A.class
   - Same.class
lib2.jar
   - B.class
   - Same.class

Actually, I don't use Same.class but it is used by class A and B

Then, what happened?

If lib1.jar is loaded first, only Same.class in lib1.jar is used for both A.class and B.class?

or A & B will use different Same.class in their own jar?

1 Answers1

1

If there isn't any special Class loader , which loads different classes at run time, the class loaded first will be used in both the places. Please check this for more info.

Community
  • 1
  • 1
BHAWANI SINGH
  • 729
  • 4
  • 8