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.


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


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