This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Methods in a interface are implicit public and variables are implicit public static and final!
Non-inner interface may have default or public access. However an inner interfaces may
have all accesslevels.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
what are inner interfaces used for. I know about the uses of inner classes, but inner inetrfaces???
They make sense when the interface is only used in conjunction with the class.
Map.Entry point out by Wouter is a good example. The Entry interface is only associated with the Map, therefore they define it as nested interface. If Map.Entry defines as separate interface, then people can refer to Map.Entry outside of the context of a Map. Define Entry as part of a Map provides better understanding of relationship.