Array of Interface in Java

后端 未结 5 852
自闭症患者
自闭症患者 2020-12-24 09:15

I have an interface.

public interface Module {
        void init();
        void actions();
}

What happens when i try to create an array li

5条回答
  •  甜味超标
    2020-12-24 09:48

    You need to create a concrete class type that would implement that interface and use that in your array creation

提交回复
热议问题