What is reason behind the array index starting with 0?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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??

27th Feb 2018, 2:03 AM
Ganesh pandurang apune
Ganesh pandurang apune - avatar
4 Answers
27th Feb 2018, 2:10 AM
Ipang
+ 5
You're welcome @Ganesh : )
28th Feb 2018, 2:05 PM
Ipang
+ 3
though popular, there are languages which go by 1 ex matlab
27th Feb 2018, 3:44 AM
Abdur-Rahmaan Janhangeer
Abdur-Rahmaan Janhangeer - avatar
+ 3
Thanks lpang
28th Feb 2018, 8:25 AM
Ganesh pandurang apune
Ganesh pandurang apune - avatar