I know about C++ pure virtual classes, but Java went one step further and created a first-class (no pun intended) concept for multiple-interface (not implementation) inheritance, the interface
. It's now a staple of major statically-typed languages. Did Java invent the interface concept? Or did it appear in older languages also as a first-class concept?
views:
261answers:
6pure virtual classes without fields were called in C++ interfaces even before Java. Idea behind Java's interfaces was to remove nasty multiple inheritance as it was in C++, but leave similar capabilities.
I'm quite sure that Java developers didn't invent the concept of interfaces but they popularize them.
As far as I know Objective-C was the first language to feature interfaces. At least it had them before Java was invented.
IDL, used by CORBA, I believe goes back to the early 80's.
Here is abstract from the article The Java Language Environment.
An interface in the Java language is simply a specification of methods that an object declares it implements. An interface does not include instance variables or implementation code--only declarations of constants and methods. The concept of an interface in the Java language was borrowed from the Objective-C concept of a protocol.
http://java.sun.com/docs/white/langenv/Object.doc2.html#6185