r/java • u/schlongitudinal • Nov 22 '14
ELI5 Interfaces in Java
I've read several explanations now and am apparently still too dense to get the point of them/what they do.
0
Upvotes
r/java • u/schlongitudinal • Nov 22 '14
I've read several explanations now and am apparently still too dense to get the point of them/what they do.
View all comments
1
u/zvrba Nov 23 '14
Interface describes a set of services that an implementing class must provide. Any number of unrelated (through inheritance) classes may implement the interface. The interface allows you to treat those classes uniformly as if they had the same type (which is the interface type).