java - Adding hashmap keys to my arraylist -
i have arraylist <string>
, hashmap<string, object>
, i'm trying add keys arraylist. iterating through, add key in arraylist.
my code:
for (string key: hmap.keyset()) { string l = ("key: " + key + "\n"); if(!array.contains(l)) array.add(l); }
Comments
Post a Comment