
Java
Example of such classes found in the core J2SE API include:
Java.awt.Component, Java.awt.geom.Point2D, Java.io.InputStream, Java.io.Reader, Java.util.AbstractCollection, and many others.
Take Java.util.AbstractCollection as a typical example. It provides placeholders for abstract methods iterator() and size(), and provides the concrete methods clear(), contains(), isEmpty(), etc. which use the former abstract methods to perform a generic function as defined in the specific implementation of a sub-class. The abstract class defers the details of the specific implementation to its sub-classes. The class Java.util.HashSet extends AbstractCollection and defines the non-abstract implementation code for both iterator() and size() methods.
Copyright © 2026 eLLeNow.com All Rights Reserved.