Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with instanceof operatior with dynamic class loading  RSS feed

 
nikhil jai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

If some class lets say "A" is implementing some interface lets say "B"
and if I create object "obj" of "A" , such that class "A" is loaded by some class loader "L" and interface B is loaded by classloader which is parent of L say "parent_L"

B loaded by parent_L
|
i.e A loaded by L

and if I say-- "obj instanceof B" , will it return true or false ?
What if B is loaded by some class loaded which has no relation with class loader of A ?
Under what all cases "obj instanceof B" can return false even when "obj" is object of A and A is implementing B ?




 
nikhil jai
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody please provide help.
 
Campbell Ritchie
Sheriff
Posts: 53750
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nikhil jai wrote:Somebody please provide help.
Read this. And have you tried anything yourself?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!