Services | Updates | Contact
Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
Search All Tutorials
Top Search: Loan Struts Open Source
Fonts - Centering Text
To find the size of a font or of a particular String.
 
Hibernate Book
Hibernate practically exploded on the Java scene. Why is this open-source tool so popular? Because it automates a tediou
 
More Tutorials...

Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

 
 
Java
Comments
 
 

 

Java Exceptions Tutorials With Examples

                         

  1. Exceptions in Java
    Exceptions are nothing but some anomalous conditions that occur during the execution of the program. Exceptions are the conditions or typically an event which may interrupt the normal flow of the program's instructions. 
      
  2. Exception Classes
    The hierarchy of exception classes commence from Throwable class which is the base class in java.lang. This class can be instantiated and thrown by the program. The Throwable class is further divided into two subclasses :- 
                                                                      
  3. Catching and Handling Exceptions
    The three exception handler components are used to catch and handle the exceptions. These are try, catch and finally clause. The mechanism to catch an exception in Java is to use try and catch block.
  4.                                                                   
  5. How to Throw Exceptions
    Before catching an exception it is must to be thrown first. This means that there should be a code somewhere in the program that could catch the exception.
  6.                                                                           
  7. Handling Multiple Catch Clauses
     In java when we handle the exceptions then we can have multiple catch blocks for a particular try block to handle many different kind of exceptions that may be generated while running the program.
  8.                                                                           
  9. Nested Try-Catch Blocks
    In Java we can have nested try and catch blocks. It means that, a try statement can be inside the block of another try.
                                                          
  10. Catching Normal Exceptions
    The exceptions that are generated by methods are referred to as normal exceptions.  We have already learned that to catch an exception we use try and catch block.
  11.                                                                   
  12. Making Custom (User Defined) Exceptions
     
    If you encounter a situation where none of those exception describe your exception accurately or if you can't find the appropriate exception in the Java API, you can code a class that defines an exception that is more appropriate
  13.                                                          
  14. What are Chained Exceptions
    Chained exceptions are the exceptions which occur one after another i.e. most of the time to response to an exception is given by an application by throwing another exception.
  15.                                                                                                                      
  16. How to Print a Stack Trace Message
    Instead of this this method you can get more information about the error process if you print a stack trace from the exception using the printStackTrace() method that prints the stack trace to the console 

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

3 comments so far (post your own) View All Comments Latest 10 Comments:

what is cancel() method in jdbc?

Posted by sridhar on Tuesday, 03.18.08 @ 10:50am | #53146

I think exception handling should be taken in detail,as it is a typical part with the help of illstrations.The hierarichy of the classes also need to be xplained.

Posted by heena jain on Thursday, 12.6.07 @ 00:55am | #41391

very useful web site for beginners of JAVA.. the way of presenting web site is too good

Posted by Mohanraj Chozhan on Sunday, 10.7.07 @ 21:52pm | #32364

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.