aspose file tools*
The moose likes Java in General and the fly likes Problem with instanceof operatior with dynamic class loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem with instanceof operatior with dynamic class loading " Watch "Problem with instanceof operatior with dynamic class loading " New topic
Author

Problem with instanceof operatior with dynamic class loading

nikhil jai
Greenhorn

Joined: Aug 07, 2008
Posts: 9
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

Joined: Aug 07, 2008
Posts: 9
Somebody please provide help.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
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
 
subject: Problem with instanceof operatior with dynamic class loading