Results 1 to 3 of 3

Thread: Matrix Message

  1. #1
    shindry is offline Member
    Join Date
    Apr 2009
    Rep Power

    Unhappy Matrix Message

    When I tried to input some double to matrix, I got this message :

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
    at sistemspl.Matrix.main(
    Java Result: 1

    I don't understand it. What should I do?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power


    Your code appears to have an array, and on line 37 of the Matrix class code, you appear to be accessing the 2nd item in an array that holds less than 2 items.

    If you want more help, you'll need to provide more detail here, much more detail including code. A great resource that has helped me and will probably help you is an article entitled How To Ask Questions The Smart Way. It will tell you how to formulate your questions so that the folks here will be better able to answer them. Good luck.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power


    At least, did you read more about the exceptions you get on the web Or Java doc?

    ArrayIndexOutOfBoundsException (Java 2 Platform SE v1.4.2)

    It's more clearly explain what's wrong with your code? As Fubarable says, if you can provide more details we can help you.

Similar Threads

  1. Help with dox matrix printer
    By Albert in forum Advanced Java
    Replies: 7
    Last Post: 09-06-2011, 08:50 AM
  2. displaying 2D-Matrix
    By srinivasmallabathula in forum New To Java
    Replies: 2
    Last Post: 02-18-2009, 07:19 PM
  3. [SOLVED] Help with Matrix
    By Bernard Robitaille in forum JCreator
    Replies: 10
    Last Post: 02-14-2009, 02:19 AM
  4. Matrix variations with repetition
    By jnovice in forum New To Java
    Replies: 4
    Last Post: 01-19-2009, 08:42 AM
  5. Help with matrix
    By susan in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 04:37 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