+ 2
What is reason behind the array index starting with 0??
Guys please anyone can tell me the answer of above question in java array is declare and initialize like int a[]=new int[5]; a[0]=1; a[1]=2; a[2]=3; a[3]=4; a[4]=5; I want reason for the why array index start from 0??
4 Antworten
+ 8
A quick web search returned several results, here are some of the links:
https://www.quora.com/Why-do-array-indexes-start-with-0-zero-in-many-programming-languages
http://www.answers.com/Q/Why_Array_Index_starts_from_Zero
Hth, cmiiw
+ 5
You're welcome @Ganesh : )
+ 3
though popular, there are languages which go by 1
ex matlab
+ 3
Thanks lpang