Total members 10261 | Gratitudes |It is currently Tue May 22, 2012 4:58 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Code Snippet
 Code subject: Exception handling
PostPosted: Tue Jan 24, 2012 10: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");
      }
   }


TOP
  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  

 Similar topics
 Exception errror at LocalDevice device = LocalDevice.getLoc
 Event Handling Notes
 Exception is not clear
 Handling m3g format (3D files for mobiles) in J2ME
 Material Handling Equipment
 Exception Handling in a project
 Session handling using Struts
 java.util classes and interfaces support event handling
 Catch database connection exception
 Define your own exception class

All times are UTC [ DST ]


Users browsing similar codes

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Code Snippet | Next Code Snippet 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team