I have the following:
int count = args.length;
Strange as it might seem I want to find out the array length without using the length field. Is there any other way?
Here's what I already (without success) tried:
int count=0; while (args [count] !=null) count ++;
int count=0; while (!(args[count].equals(""))) count ++;}
IndexOutOfBoundsException
if you access an element beyond the end of the array, so you could always iterate inside atry/catch
block, and note the index that first threw the exception.