fred rosenberger wrote:System.out.println can be your best friend. print out what i, last, and the various array's lengths are, just before the line where you get the error.
how would I achive that here?
The point of the exercise is to find mac adresses according to their ssid from a list.
Remember that the usual error message for an array out of bounds exception tells you the wrong index: if you try index 5 in a 4‑element array, the error message will probably have 5 in.
And remember that index 5 points to the 6th element in an array.
Check out line 2 the parameters of the searchFirst method. The first Parameter is arrayWlanMac when it should be arrayWlanSsid.
It now works and I have on more question to follow in the following post.
Campbell Ritchie wrote:Array index -1???
The one way I can think to get that error is if you have searched for something and not found it. Then you may get an index of -1. Obviously you cannot use -1 as a real array index.
That problem is solved, I just had another question above.