This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
But even after the method completes, the inner class object created within it might still be alive on the heap if, for example, a reference to it was passed into some other code and then stored in an instance variable
how do we do this. I tried to do sth like this:
how is it possible to have an object of rutime-type object as that of the inner class or may be its extension as in the case mentioned above???
also i'm not able to understand the o/p of this line: System.out.println(mi.getClass().getName()); //MyOuter2$1 ???
why i'm not geeting anything like MyInner$1???
and since i'm catching the argument-local anonymous class, polymorphically as type Object, how can we say that the oject created inside the method outlives the method invocation???