Win a copy of Design for the Mind this week in the Design 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
Posts: 48652
56
  • 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: 20511
54
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