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...
Type: Posts; User: snowguy13
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...
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).
...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())....
@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...
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...