I was reading my old SCJP 6 book(author Kathy Sierra,Bert Bates) mentioned
- All the
interface
methods are implicitlypublic
andabstract
by default interface
methods must not bestatic
For example, if we declare
interface Car
{
void bounce(); //no need of public abstract
void setBounceFactor(int b); //no need of public abstract
}
What the compiler sees
interface Car
{
public abstract void bounce();
public abstract void setBounceFactor(int b);
}
But from Java 8, interfaces can now define static methods. see this article everything-about-java-8
My question, what is the implicit declaration of interface methods in Java 8? Only public
or nothing?