maximum size of ArrayList

Discussion in 'Java' started by Armin Preis, Oct 12, 2003.

  1. Armin Preis

    Armin Preis Guest

    Is an ArrayList limited to a number of 258 elements? (in my case Characters)

    As adding more than 258 elements to an ArrayList brings up an

    java.lang.ArrayIndexOutOfBoundsException

    Hope you can help me.


    Regards,
    Armin Preis
     
    Armin Preis, Oct 12, 2003
    #1
    1. Advertising

  2. On Sun, 12 Oct 2003 19:27:01 GMT, Armin Preis wrote:
    > Is an ArrayList limited to a number of 258 elements? (in my case Characters)
    >
    > As adding more than 258 elements to an ArrayList brings up an
    >
    > java.lang.ArrayIndexOutOfBoundsException
    >
    > Hope you can help me.


    Even if there were a hardcoded limit, 258 would be a ridiculously low
    value for it.

    There must be something wrong with your code. Post a short, complete
    example that causes the exception.

    Most likely you've specified an incorrect index.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Oct 12, 2003
    #2
    1. Advertising

  3. Armin Preis

    Armin Preis Guest

    Gordon Beaton wrote:

    > Even if there were a hardcoded limit, 258 would be a ridiculously low
    > value for it.


    That's what I thought too.

    > There must be something wrong with your code. Post a short, complete
    > example that causes the exception.
    >
    > Most likely you've specified an incorrect index.


    You're absolutely right.

    Thank you!

    Regards,
    Armin Preis
     
    Armin Preis, Oct 12, 2003
    #3
  4. Armin Preis

    Roedy Green Guest

    On Sun, 12 Oct 2003 19:27:01 GMT, Armin Preis <>
    wrote or quoted :

    >Is an ArrayList limited to a number of 258 elements? (in my case Characters)


    no, but you must add them in order.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Oct 12, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Saravanan Rathinavelu

    Iterate through ArrayList using an another ArrayList

    Saravanan Rathinavelu, Aug 16, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    2,744
    Natty Gur
    Aug 19, 2003
  2. Kaidi
    Replies:
    4
    Views:
    2,387
    Kaidi
    Jan 3, 2004
  3. xz
    Replies:
    16
    Views:
    2,379
  4. Philipp
    Replies:
    6
    Views:
    928
    Arne Vajhøj
    May 28, 2008
  5. phanhuyich
    Replies:
    4
    Views:
    278
Loading...

Share This Page