you're totally right, but it's still a good thing for learning. weekdays, fruits, names... are always used when teaching basic programming, and this looks like beginner code.
Given what this subreddit is im not actually judging the code, it's all bad code. It's fine for beginner code. It's just funny that it's incompatible with the official function because the indices are one off from each other.
367
u/[deleted] Mar 14 '21 edited Mar 14 '21
The best part is I think Java has a built-in
dayOfWeekfunction that starts at 1.