as we know,we can define allow multiple implement type in java programmering by two ways:interface and abstract.
althrouh interface exclusive method's implementation.but,using interface do not prevent you to provide help on implementation,throuht provide a abstrat skeletal implemantation for every important interface which you export.we can combine interface with abstract class.
in accordance with practice.skeletal implementation called as AbstractInterface.here skeletal implementation is the name of the implemented interface.for example.Collections Framework provide a skeletal implementation for every important collection interface,include,AbstractCollection,AbstractSet,AbstractList and AbstractMap,we also can call them as skeletalCollection,skeletalSet,skeletalList,skeletalMap.it is deep-rooted that the use of Abstract's usage.
ok,let use the implementation of HashSet to explain it.AbstractCollection implements collection interface.simple implementation in it body to simulate multiple inheritance.
public abstract class AbstractCollection<E> implements Collection<E> {
protected AbstractCollection() {
}
public abstract Iterator<E> iterator();
public abstract int size();
public boolean isEmpty() {
return size() == 0;
}
/**
* {@inheritDoc}
*
* <p>This implementation iterates over the elements in the collection,
* checking each element in turn for equality with the specified element.
*
* @throws ClassCastException {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
*/
public boolean contains(Object o) {
Iterator<E> it = iterator();
if (o==null) {
while (it.hasNext())
if (it.next()==null)
return true;
} else {
while (it.hasNext())
if (o.equals(it.next()))
return true;
}
return false;
}
}