Container Class:
An abstract class Container is a subclass of the abstract class Component. It declares methods for nesting components in a container. A container is a component that can accommodate other components and thereby other containers since a container is also a component by virtue of inheritance.
Containers provide the functionality for building complex, hierarchical graphical user interfaces. They define a component hierarchy in contrast to the inheritance hierarchy defined by classes. A Container gives overloaded method add ( ) to involve components in a container. The container uses a layout manager to position its components.