Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - getting value from an array using string

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.

like image 932
Ewen Avatar asked Dec 21 '22 16:12

Ewen


1 Answers

you could use a HashMap - see here for more info!

like image 102
Lukas Olsen Avatar answered Dec 24 '22 02:12

Lukas Olsen