This post originated from an RSS feed registered with Java Buzz
by News Manager.
Original Post: The Six Roles of the Interface
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Newcomers to the Java language often experience confusion. Their bafflement is largely due to Java's palette of exotic language features, such as generics and lambdas. However, even simpler features such as interfaces can be puzzling.
Recently, I confronted a question on why Java supports interfaces (via interface and implements keywords). When I began to learn Java in the 1990s, this question was often answered by stating that interfaces get around Java's lack of support for multiple implementation inheritance (child classes inheriting from multiple parent classes). However, interfaces serve as much more than a kludge. In this post, I present the six roles that interfaces play in the Java language.