Can we create an instance of an interface in Java? [duplicate]
You can never instantiate an interface in java. You can, however, refer to an object that implements an interface by the type of the interface. For example, public interface A { } public class B implements A { } public static void main(String[] args) { A test = new B(); //A test = new A(); … Read more