Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with instanceof operatior with dynamic class loading

 
nikhil jai
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somebody please provide help.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • 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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic