I understand that Interface methods are implicitly public
. Java Docs Tutorial says
All
abstract
,default
, andstatic
methods in an interface are implicitlypublic
, so you can omit the public modifier.
Out of abstract, static and default, which modifiers are implicitly declared in Java 8.
I thought abstract
was not implicitly declared anymore as Java 8 introduced default
method in interfaces, but I still get a warning in Intellij IDEA.
Modifier '
abstract
' is redundant for interface methods.
public interface TestInterface {
abstract int print(); // abstract redundant ?.
int print2(); //legal.but public or public abstract ?.
}