I have this interface:
public interface Animal {
public void Eat(String name);
}
And this code here implements the interface:
You can't instantiate an interface. The functionality can be considered similar to that of an abstract class. You can have a reference to the interface but you don't create an object of interface. If you do something like this....
Animal a = new Animal(); The compiler will show an error- "Cannnot instantiate the type Animal".