Results 1 to 2 of 2
  1. #1
    thelinuxguy is offline Member
    Join Date
    Dec 2008
    Posts
    44
    Rep Power
    0

    Default [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

  2. #2
    thelinuxguy is offline Member
    Join Date
    Dec 2008
    Posts
    44
    Rep Power
    0

    Default [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

  1. ArrayIndexOutofBoundsException help
    By filly444 in forum New To Java
    Replies: 9
    Last Post: 09-03-2008, 06:16 PM
  2. java.lang.ArrayIndexOutOfBoundsException
    By mensa in forum Java 2D
    Replies: 7
    Last Post: 05-05-2008, 10:09 AM
  3. java.lang.ArrayIndexOutOfBoundsException
    By riccian in forum New To Java
    Replies: 0
    Last Post: 03-18-2008, 10:38 AM
  4. ArrayIndexOutOfBoundsException
    By daredavil82 in forum New To Java
    Replies: 2
    Last Post: 12-14-2007, 10:29 PM
  5. java.lang.ArrayIndexOutOfBoundsException
    By Marcus in forum New To Java
    Replies: 1
    Last Post: 07-05-2007, 06:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •