I have maybe a simple question.
Here two code-snippets to show what I mean:
Example 1:
public interface SomeInterface{
public void someMethod(...);
}
Example 2:
public interface AnotherInterface{
void anotherMethod(...);
}
So, Example 1 is completely clear to me but Example 2 isnt.
In fact, is there any difference between those two examples expect the public
-modifier?
On one hand I found that methods from Interface
s are implicitly public
but on the other hand I have found that methods declared in an Interface
are "package-public" (I dont now if thats the correct description) - saying these are visible to all classes in the same package as the Interface
.
For now I am completely confused.. So could someone please explain me whats right?
Thanks anyways.