This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 38033
    
  22
nikhil jai wrote:Somebody please provide help.
Read this. And have you tried anything yourself?
 
 
subject: Problem with instanceof operatior with dynamic class loading
 
Similar Threads
Instance of
PGJC mock exam question
JQPlus question on "instanceof"
instanceoff
operator instanceof confusion