gnasher729
Suspended
You indeed can have a separation of the implementation from the interface in Java - write the interface as an interface "public interface MyAPI { ... }" and the implementation as "public class MyAPIImpl implements MyAPI { ... }" - so I'm not sure what forces you to see the code (versus the API alone). Yes, there's a lot of programmers that don't create the interface separate of the implementation, or don't even think much of what the interface means or its importance in keeping these concerns separate and the interface hardened and defined as much as possible, but this is by choice. The language does allow you to keep the API separate from the implementation (and a lot of good source code I've seen, e.g. JBoss AS, does do this indeed for every class they produce).
Java does not insist you mix the code w/the interface - the programmer does however 🙂 (unwittingly or not).
You can have Java interface with either C or C++, without a problem, via JNI, and it works quite well.
The first point means I have to add an abstraction layer that doesn't serve any purpose at all except creating an abstraction layer (I think there is a book about "anti-patterns" that would have a word or two to say about that).
And JNI forces me to put another implementation layer between the caller and existing libraries, serving no purpose other than making code accessible that I could use at no cost in Objective-C.
In both cases, there is another set of maintenance tasks added, since every change in any interface now requires more changes in more places than it used to.