Originally posted by seetharaman venkatasamy:
you can not create instance of innerclass from different class(other than outer class)
Yes you can, as long as a) it's visible, and b) you have a reference to an enclosing outer class.
Somnath,
the problem in your code is that MyInner is NOT an inner class - it's a toplevel class instead. If you want it to be an inner class,
you should put the entire class definition
inside the class definition of MyOuter. Basically, just move the last } of your outer class to after the inner class (and then fix indentation).
You might want to know that, from an inner class, you can get a reference to its outer class by calling MyOuter.this
[ August 14, 2008: Message edited by: Rob Prime ]