Friday, February 27, 2009

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:

Anonymous said...

What is the use this anonymous inner class?...

Post a Comment