Hi, i have these two classes,
My Question is how do i access the foo method in the anonymous class? Its not getting invoked!!or should i have to make it a local inner class?
<pre>
public interface MyTest
{
public void foo();
}
public class Outer
{
public void aMethod()
{
new MyTest()
{
int i =10;
public void foo()
{
System.out.println("Success" +i);
}
};
}
public static void main(
String args[])
{
Outer o = new Outer();
o.aMethod();
}
}
</pre>
In case of anonymous eventlisteners, how does the public void ActionPerformed(ActionEvent e) method get executed when there's no explicit call to it?
[This message has been edited by
Paul Wheaton (edited August 20, 2000).]