Exception handling

Tue Jan 24, 2012 9:06 am

Code:
public class S{

   public static 
void main(String args[]){
      
int a[] = new int[2];
      try{
         
System.out.println("Access element three :" a[3]);
      }catch(
ArrayIndexOutOfBoundsException e){
         
System.out.println("Exception thrown  :" e);
      }
      
finally{
         
a[0] = 6;
         
System.out.println("First element value: " +a[0]);
         
System.out.println("The finally statement is executed");
      }
   }




  Related Posts  to : Exception handling
 Exception Handling in a project     -  
 how to design a exception handling for a project     -  
 exception handling try and catch in Python     -  
 Out of Bounds exception     -  
 Exception is not clear     -  
 String Too Long Exception     -  
 Exception Handler in java     -  
 Multiple Exception Catching     -  
 Define your own exception class     -  
 java.security Exception in Applet     -  

Topic Tags

Java Exceptions