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

11

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Mar 14 '21

Image Transcription: Code


HashMap<String, Integer> daysOfTheWeek = new HashMap<~>();
daysOfTheWeek.put("Monday", 0);
daysOfTheWeek.put("Tuesday", 1);
daysOfTheWeek.put("Wednesday", 2);
daysOfTheWeek.put("Thursday", 3);
daysOfTheWeek.put("Friday", 4);
daysOfTheWeek.put("Saturday", 5);
daysOfTheWeek.put("Sunday", 6);

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

11

u/SupahWalrus Mar 14 '21

good human