为什么在Java数组索引从0开始?

问题描述:

为什么数组索引 0像Java编程语言完成的,而不是1?
我完全对Java任何解释表示欢迎。

Why is array indexing done with 0 and not with 1 in programming languages like Java ? I am totally new to java any explanation is welcomed.

Java使用从零开始的索引,因为C使用从零开始的索引。 C使用从零开始的索引,因为数组索引无非就是内存所抵消,所以数组的第一个元素是它已经指向内存中, *(数组+ 0)

Java uses zero-based indexing because c uses zero-based indexing. C uses zero-based indexing because an array index is nothing more than a memory offset, so the first element of an array is at the memory it's already pointing to, *(array+0).