Interface can only contain abstract methods, properties but we don’t
need to put abstract and public keyword. All the methods and properties
defined in Interface are by default public and abstract.
インターフェイスのすべてのフィールドはパブリック、静的、および最終的なものです...
Interface variables are static because Java interfaces cannot be instantiated
in their own right; the value of the variable must be assigned in a static
context in which no instance exists. The final modifier ensures the value
assigned to the interface variable is a true constant that cannot be
re-assigned by program code.
元:
public interface Test
{
int value = 3; //it should be same as public static final int value = 3;
}
interface の Member 関数の場合。
A method declaration within an interface is followed by a semicolon,
but no braces, because an interface does not provide implementations
for the methods declared within it. All methods declared in an interface
are implicitly public, so the public modifier can be omitted.
メソッドはインターフェイスで Final ではないことを意味します。
詳細については、このチュートリアルを参照してください