Results 1 to 2 of 2
- 05-07-2009, 10:17 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 44
- Rep Power
- 0
[SOLVED] ArrayIndexOutOfBoundsException
Hi
I have created a client/server application in order to send an array from the server to the client for calculations. I am trying to send half of the array A[n/2][n] to the client but keep getting the error message:-
Please enter value of n
24
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 12
at TCPserver.main(TCPserver.java:80)
Does anyone know what this means?
Any help appreciated
theLinuxGuy
- 05-07-2009, 10:34 PM #2
Member
- Join Date
- Dec 2008
- Posts
- 44
- Rep Power
- 0
[Solved] Problem Solved
Hi
I have solved the problem. I had not altered a calculation featured later in the program.
for (i=0;i<m;i++)
for (j=0;j<n;j++)
for (k=0;k<n;k++)
C[i][j] = C[i][j] + A[i][k] * B[k][j];
where i=m, previously it was still i = n, n being the full array length and not half the length therefore I got an index out of bounds exception, because I was trying to make use of a part of the array that did not exist.
Thanks to anyone who was thinking of responding
Regards
theLinuxGuy
Similar Threads
-
ArrayIndexOutofBoundsException help
By filly444 in forum New To JavaReplies: 9Last Post: 09-03-2008, 05:16 PM -
java.lang.ArrayIndexOutOfBoundsException
By mensa in forum Java 2DReplies: 7Last Post: 05-05-2008, 09:09 AM -
java.lang.ArrayIndexOutOfBoundsException
By riccian in forum New To JavaReplies: 0Last Post: 03-18-2008, 09:38 AM -
ArrayIndexOutOfBoundsException
By daredavil82 in forum New To JavaReplies: 2Last Post: 12-14-2007, 09:29 PM -
java.lang.ArrayIndexOutOfBoundsException
By Marcus in forum New To JavaReplies: 1Last Post: 07-05-2007, 05:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks