What is the output of the following program? And explain why.
public class Testing {
public static void main(String[] args) {
int a [] = { 0, 0, 0 };
update(a, a[2]);
try { System.out.println(a[2]/a[1]); }
catch(Exception e) { System.out.println("Exception!"); } finally { System.out.println("Finally!"); }
}
static int update(int x[], int y) {
for (int i = 1; i < x.length; i++)
if (y < x.length) x[i] = x[i - 1] + 1;
return x[1];
}
}

