when i run this code without passing commandline argument
it generates ArrayIndexOutOfBoundsException
but when i run the below pgm it generates compiletime error
variable might not have been initialized
what is the difference between the two..why the second pgm wont generate the same Exception
Get a pencil and paper, and go through the execution; at each line write down what the contents of the array a and the array ab are. That should tell you why you get whichever Exception or compiler error you are suffering.