Saturday, 21 January 2012
JAVA: What is the difference between error and an exception?
Do you like this Article?
In Java, under Throwable class, there are 2 sub-classes named Exception and Error.
Exception class:
Exception class:
- It is used for exceptional conditions that user programs should catch.
- It's also the class that you will sub-class to create your own custom exception types.
- For example, NullPointerException will be thrown if you try using a null reference.
- It indicates serious problems that a reasonable application should not try to catch.
- It's used by the Java run-time system to indicate errors having to do with the run-time environment, itself.
- For example, stack overflow is an error.
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...
5 Responses to “ JAVA: What is the difference between error and an exception? ”
16 November 2013 at 02:05
how to handle the error in application?
3 August 2018 at 15:52
Definitely it will be useful for many people. So please keep update like this.java training
29 August 2018 at 18:25
I found best article.thank you for sharing useful info.
visit
web programming tutorial
welookups
10 October 2021 at 15:05
Thanks for shaaring
4 August 2023 at 17:10
Agario Benzeri Oyunlar
Clash Royale Benzeri Oyunlar
Sanalika Benzeri Oyunlar
Raft Benzeri Oyunlar
Dark Souls Benzeri Oyunlar
KTF
Post a Comment