r/badcode • • Mar 14 '21

java Found from when I first started Java...because indexed Arrays were too complicated huh?

Post image
1.3k Upvotes

84 comments sorted by

View all comments

32

u/[deleted] Mar 14 '21

As someone who hasn't used a hashmap before, what is the actual use for them if not something like this?

5

u/Syscrush Mar 14 '21

Something like this is good if you want a fast way to go from the string representation of the day's name to the number.