Interfaces

Chapter 2 briefly defined two types of inheritance: implementation and interface. Interface inheritance and how it is treated in Java is quite unique among object-oriented languages. This isn't to say that other languages don't support interfaces. C++ doesn't formally distinguish the construct, but an interface can be implemented by extension of a class in which nothing but pure virtual functions are defined. In Visual Basic, interface inheritance is accomplished through the implements keyword. Java has a little in common with Visual Basic in that regard because it, too, uses the keyword implements. However, this is where the similarity ends.

The designers of the Java language wisely granted interfaces their own unique definition. ...

Get Developing Applications with Java™ and UML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.