java - Which Array / List should I use to keep an static index? -


i use hashmap<integer, object> keep array of objects can items integer.

i'm showing example can understand.

hashmap<integer,string>:

[0] - hello
1 - how doing
[2] - bye

so hashmap, can remove items avoiding rest moving indexes.

hashmap.remove(0)

[0] - null
1 - how doing
[2] - bye

but hashmap shouldn't used indexes integer. so... which kind of array should use perform actions ones explaining above?

edit: part of "shouldn't used", android eclipse telling me: enter image description here

you can use simple array. can pointed integer. , other calling remove can set null specific place. if want call remove write own wrapper method you.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -