There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James:
As to why interfaces and not just abstract classes ... interfaces are rarely absolutely necessary. Plenty of languages get along without them, so it is apparently possible to design around them. The biggest advantage is that you can implement two or more interfaces where you could not extend two or more abstract classes.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
cruft creator
Now compare that with the API.public interface Map<K,V> {
// Query Operations
/**
* Returns the number of key-value mappings in this map. If the
* map contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
* <tt>Integer.MAX_VALUE</tt>.
*
* @return the number of key-value mappings in this map
*/
int size();
/**
* Returns <tt>true</tt> if this map contains no key-value mappings.
*
* @return <tt>true</tt> if this map contains no key-value mappings
*/
boolean isEmpty();
Perform for today. Adapt for tomorrow.
Perform for today. Adapt for tomorrow.
Originally posted by Rahul Shilpakar:
the best use of interface generally is declareing Constants which all the application uses it.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Consider Paul's rocket mass heater. |