Possible Duplicate:
exception handeling, creating log and continue the program in JAVA
I am designing a program in JAVA that captures results in about 10 iterations, and after that i have to write all the results in a log file, I need a solution that if any exception occurs then it should be written on my text file and secondly the program must not stop, it must go on till the last iteration is completed... ie if some error occur on any part of any iteration, it must be mentioned within my results by the name of error and the program must not stop here, it must go on and update my log file
see this just for example: because my class is around 1800 lines can't paste all here.
float j,i,t;
int []a={1,2,0,3,4,5};
int []b={6,6,9,3,4,5};
for(int i=0;i<6;i++)
{
j=2/a[i];
i=3/b[i];
t=4/b[i];
}
so here due to 0 in list of values of arrray an exception occurs, thus stopping the whole iteration, i want that to skip, if some exception occur the loop must not be broken, it just leave out that exception part and write on a text file.