As you know, in a java interface, all methods have to be defined as abstract. But when I define a method as not typing abstract, the compiler says it is okay. I know that an abstract method must not have a body. Does a method somewhere in an interface necessarily have a name abstract or not? : What i mean is, what is the difference between:
public interface blabla {
public void aMethod();
//or
public abstract void aMethod();
}
No, marking an interface method as
abstracthas no meaning and is never required.All interface methods are implicitly
abstract(andpublictoo btw).From the JLS:
Related question (+ answer with a historical reference to a statement saying that
abstractwas once required for interface methods):