Component and container classes in Java

Explain the component and container classes.

The Component class is found under java.awt package. The container class is the subclass of Component class. All non-menu-related elements that comprise a graphical user interface are derived from the abstract class Component. The Component class defines a number of of methods for handling events, changing window bounds, controlling fonts and colors, and drawing components and their content.

A container is a component that can accommodate other components and also other containers. Containers provide the support for building complex hierarchical graphical user interface. Container provides the overloaded method add () to include components in the container.
Difference between runtime and plain exception
Runtime Exceptions like out-of-bound array indices, NullPointerException , AirthmeticException are all subclasses of java.lang.RuntimeException class...
Life cycle for stateless and stateful beans
Stateless Session Bean Lifecycle: The stateless session bean does not become passive, so its life cycle has two stages:...
Passivation and Activation in EJB
Activation is a process of associating an instance with EJB object. Activating a bean is the process of restoring a stateful bean instance’s state relative to its EJB...
Post your comment