Object-Oriented Interfaces – Can Interface Be Not Abstract?

interfacesobject-oriented

Friend of mine said that not every interface is abstract. I haven't chance to discuss that with him but it get me thinking of not abstract interface in any type of language.

Is there a non abstract interfaces?

Best Answer

Simple answer to your question : No, your friend is wrong.

An interface provides no implementation of the methods it defines. Would it make sense if we could instantiate one of those? Of course not. Interfaces are only that, an abstraction.

This is obviously assuming that when you say interface, you think about the interface language feature as defined by C#, Java, C++, etc with the interface keyword. In the case your friend means an API interface, then the question does not really make sense to me. APIs may allow you to extend functionality through subclassing or by adhering to a particular contract as defined by an interface or an existing class of the system.