Wednesday, 18 January 2012
JAVA: Checked and UnChecked Exception
Do you like this Article?
In Java, there are lots of sub-classes under java.lang.Exception class. we can divide these sub-classes into 2 types on the basis of compile-time checking.
The types are - Checked Exception & Unchecked Exception.
Checked Exception:
- Except RuntimeException( java.lang.RuntimeException) class, all sub-classes of Exception are checked exception.
- These exceptions need to include in a method's throws list, because these are checked by the compiler during compile time if a method handles or throws these exception.
Unckecked Exception:
- RuntimeException and its sub-classes are called as unchecked exception.
- We don't need to include in a method's throws list, because these are not checked by the compiler during compile time.
Subscribe to:
Post Comments
(
Atom
)
Popular Posts
-
public - public means everyone can access it.That means it's in global scope. As, main method is called by JVM [ Java Virtual Machine...
-
throw is used to throw an exception in a program, explicitly . Whereas, throws is included in the method's declaration part, wi...
-
Singleton in one of the most popular yet controversial design pattern, in the world of object oriented programming. It's one of t...
-
Web Container / Servlet Container / Servlet Engine : In J2EE Architecture , a web container (also known as servlet container or ser...
-
Program compiles. But at runtime throws an error “NoSuchMethodError”.
-
Vector : It's synchronized. It's slower than ArrayList. It's generally used in ...
-
doGet(): protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, java.io.IOException – is a met...
-
In Java Programming Language , we must declare a variable name and type, before using it. The data type of a variable defines the th...
1 Responses to “ JAVA: Checked and UnChecked Exception ”
29 August 2018 at 18:25
I found best article.thank you for sharing useful info.
visit
web programming tutorial
welookups
Post a Comment