Why can I define only default and static methods inside a java interface,while other access modifiers like protected and public having much more privilege than default can't be used?
interface int1
{
default void add(int a, int b)
{
}
static void sub(int a, int b)
{
}
}
interface int1
{
public void add(int a, int b)
{
}
protected void sub(int a, int b)
{
}
}
--shows error message at compile time "Abstract methods do not specify a body"