Re: Know the runtime class
Dick Eimers <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.user |
|---|---|
| Organization | UU.nl |
| Message-ID | <[email protected]> |
> Is there any way to know the instance of the object of A in the class C? > Which API method should I use for this? Don't whether I understand you question, but java.lang.Object.getClass takes no arguments and returns the class descriptor, i.e. an object belonging to java.lang.Class, associated with the object on which this method is invoked. A side-note; Have you thought of the problems you are about to run into considering local variables.. I mean fields can be accessed easily and utilizing the java.lang.reflection and getClass can be used to find out the runtime class of a value, but object references that are somewhere on the operand stack; dynamic checks that (un)wind the stack? Problems assure that you don't generate checks that operate on unitialized objects.. Have fun..