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
  

 
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
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
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

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

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

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.

Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  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

Indian Software Development Company | iPhone Development Company in India

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

Copyright © 2008. All rights reserved.