12/13


#1



https://www.codecademy.com/courses/learn-java/lessons/data-structures/exercises/hashmap-iterating?action=lesson_resume


I don't understand why its printing the ket set not in the same order as i entered the keys.
Its suppose to be Turkey Burger then Naan Pizza and then Cranberry Kale Salad. why when im printing using the key set the order is Turkey Burger then Cranberry Kale Salad and then Naan Pizza.


Replace this line with your code.


#2

Hashmaps don't promise to store entries in order, you would need another data structure for behaviour like that, for example an arraylist


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.