posted 16 years ago
Yes you can define a class inside a constructor. As constructor is also a method you can define
a) Method local inner class.
b) Annonymous Inner lass
Both the above type of class can access the memebers of the Outer class as these are considered as memebers of the outer class.
You cannot declare nested static class inside a method. As the only modifiers that are applicable for a method local inner class are abstract and final.
This is show below