0
Is there a logical reason that arrays in most languages are zero-indexed?
2 Answers
0
This is just a gues, but all bases start counting with 0 and binary is a common base in computers which is made of 1s and 0s so it only makes sense to start with the first number.
If this is wrong remember it's just a semi-educated guess
0
There is. Java inherits arrays syntax from C language. And in C array variable stores just an address of the first element. And position of every element is calculated as sum of beginning address and element index. While you already have starting address you don't need to add anything to get it. So it's logical that first index is zero.