継承先でstatic method of interfaceは、利用できない
static method of interfaceは使用用途としてはfactory的なもの
自分をimplementsしてるクラスをnewする。
なのでstatic method of interfaceはこのインターフェース内で使用するもの
であり、継承されない
interface A {
static void method() {
System.out.println("aaaa");
}
}
interface B extends A{
}
class C implements A{
}
public class Outer implements A {
public static void main(String[] args) {
A.method();
B.method();
C.method();
method();
}
}
com/mycompany/mavenproject1/Outer.java:[27,8] シンボルを見つけられません
シンボル: メソッド method()
場所: インタフェース com.mycompany.mavenproject1.B
com/mycompany/mavenproject1/Outer.java:[28,8] シンボルを見つけられません
シンボル: メソッド method()
場所: クラス com.mycompany.mavenproject1.C
com/mycompany/mavenproject1/Outer.java:[29,7] シンボルを見つけられません
シンボル: メソッド method()
場所: クラス com.mycompany.mavenproject1.Outer