interface Animal
{
void eat();
}
class zoo
{
Animal GetAnimal()
{
return new Animal()
{
public void eat()
{
System.out.println("animal eat");
}
};
}
}
class Test
{
public static void main(String []args)
{
zoo z=new zoo();
Animal an=z.GetAnimal();
an.eat();
}
}