• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with instanceof operatior with dynamic class loading

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somebody please provide help.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

nikhil jai wrote:Somebody please provide help.

Read this. And have you tried anything yourself?
reply
    Bookmark Topic Watch Topic
  • New Topic