Anonymous inner class implements some interface
package innerclass;
interface Inter
{
public void m2();
}
class Test
{
public static void main(String arg[])
{
Inter i=new Inter(){
public void m2()
{
System.out.println("Hai");
}
};
i.m2(); // hai
}
}
1 comments:
What is the use this anonymous inner class?...
Post a Comment