Search:

Type: Posts; User: snowguy13

Search: Search took 0.20 seconds.

  1. Replies
    10
    Views
    2,055

    Re: How to properly make this ArrayList?

    Hm...

    Then I would try using the casting as you had suggested earlier. This wouldn't run into any problems, so long as you don't run into any all-digit strings (such as "693" or "212"); these...
  2. Replies
    10
    Views
    2,055

    Re: How to properly make this ArrayList?

    Okay. In that case, I'd use two ArrayLists, one of Strings and another of Integers (the Integer class I mean; ints won't work).
  3. Replies
    10
    Views
    2,055

    Re: How to properly make this ArrayList?

    ...Okay, I'm a little more confused now. That casting idea is a good one; however, you would need a way to check if something was originally an int (I'd use try and catch with Integer.parseInt())....
  4. Replies
    10
    Views
    2,055

    Re: How to properly make this ArrayList?

    @mwebb

    Here's a specific question for you:

    Do the Strings and ints that you are working with come in pairs, or are you instead working with data which contains mingled Strings and ints?

    If...
  5. Replies
    10
    Views
    2,055

    Re: How to properly make this ArrayList?

    I'm still confused; even after re-reading this. But I can offer this:

    1) ArrayLists -- and all other Collections, for that matter -- don't work with primitive types. Since they require a class...
Results 1 to 5 of 5