2 ms·
Java supports separate compilation and binary compatibility, so any class needs to be compilable without knowing anything about any other class other than its s
by pron 4y ago
Java supports separate compilation and binary compatibility, so any class needs to be compilable without knowing anything about any other class other than its signatures, and cannot depend on knowledge about code inside methods.
- rcme 4y agoSure, but it’s up to the user to ensure that a compatible implementation is available at runtime. And generally people don’t compile against the interface. They compile with the implementation present. Just as you get a runtime exception if you invoke a missing method, you could get a runtime exception for accessing uninitialized state.