Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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: 48946
60
  • 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: 20527
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic