Hello Jim, All,
Here is my understanding about use of extending classes in a local method.
A typical use for this feature could be
-To create customized objects from within a method
-Hide the details about creation and implementation of these objects
In other words, I call a method and I get back an object which implements a certain
interface. I get different types of objects, each in a different state depending
upon the method parameters. Code outside the method knows nothing except the
object it gets back.
This is encapsulation and
polymorphism down to the method level.
Using non local member classes will expose the code to other members but will still limit the visibility to the enclosing class.
Similar concept could apply to inner classes being discussed in this
thread.
I hope it makes sense. Feel free to correct me.
An example follows.
[This message has been edited by rajsim (edited June 20, 2000).]