Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the java correponding collection to Dictionary<string, string>

Tags:

java

coming from .Net world, just want to know what is the corresponding collection to .Net Dictionary

like image 768
user496949 Avatar asked Feb 09 '26 15:02

user496949


1 Answers

Probably:

Map<String, String> map

If you want ordered keys:

map = new TreeMap<String, String>();

If you want O(1) ops instead of O(lg n):

map = new HashMap<String, String>();
like image 124
James Avatar answered Feb 13 '26 16:02

James



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!