Suppose we have an interface such as
public interface anInterface
{
public void aMethod();
}
and a class as follows:
public class aClass
{
public void aMethod()
{
//bla bla bla
}
}
Now I'm going to define another class such as Subclass that extends aClass and implements anInterface, as in:
public class Subclass extends aClass implements anInterface
{
public void aMethod()
{
//do something
}
}
What does exactly aMethod() do in Subclass? Does it implement the method in anInterface? Or does it overrides the method in aClass?
What should I do in order to make aMethod() implement the method of anInterface? Similarly, if I want it to override the method in aClass, what can I do with it?