Difference between runtime and plain exception

What is the difference between a runtime exception and a plain exception?

Runtime Exceptions like out-of-bound array indices, NullPointerException , AirthmeticException are all subclasses of java.lang.RuntimeException class, which is a subclass of Exception class. They are known as unchecked exceptions, meaning that the programmer have no need to make a method for catching these exceptions. If they are not caught explicitly it is dealt by the default exception handler.

The exceptions other than RuntimeException all exceptions are called checked exceptions. The compiler ensures that if a method can throw a checked exception, directly or indirectly, then the method must explicitly deal with it. The method must catch the exception and take appropriate action.
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...
How do we implement caching in JSP?
JSP caching lets you cache tag invocation results within the Java engine. Each can be cached using different cache criteria. JSP caching is defined by following:..
Post your comment