So I have written this code but I don't fully understand how it works. Can anyone please explain to me what it does basically please? THANK YOU!
public class Spider extends Animal
{
/**
* Act - do whatever the Lizard wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public static int FlysEaten = 0;
public void lookForFly()
{
if ( canSee(Fly.class) )
{
eat(Fly.class);
FlysEaten++;
}
}
}

