I'm on my way to programming a database application and in our course we are told to implement a library of elements using one of the Java Collections. Each of the elements has a unique ID with which it's supposed to be addressed. Now I am wondering how this can be done.
I though about using a ListArray but this won't work because the only way of addressing List elements is through the index which you can't control.
Do you have some advice for me?
Map<IndexType, YourEntityType>
. Map
is an interface; the most commonly used implementation is HashMap
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.