I need to make an int array using Strings instead of ints.
EX: int["number2"] = 0; instead of int[2] = 0;
Does anyone know how to do this?
Thanks for your time.
feedback
|
Java doesn't support associative arrays, but you could use a HashMap:
| |||
feedback
|
You are not looking for an array but for an associative array. In Java, in practice, every class that implements | |||
feedback
|
This syntax looks very like a map in Groovy, In Java, you could use something like a | |||
feedback
|
you could use a HashMap - see here for more info! | |||||
feedback
|