Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on class loading

 
abhishek pendkay
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if there are 2 jar files in WEB-INF/lib directory of (a.jar and b.jar), they both have the same class but different implementation, which one gets loaded into JVM/ is it alphabetical? what's the order of precedence?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49405
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. Try it. Remember "name" for a class includes its package.
 
Rob Spoor
Sheriff
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the official answer is "undefined". But as Campbell said, it only applies if the fully qualified name is exactly the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic