java - How do I get an array to place a zero on the first element and not skip it? -


the following code place 1 on list[0]:

for (int = 0; < list.length; i++)     list[i] = + 1; 

if change

int = 1  

it skip list[0] , place 2 on list[1]

i want this:

list[0] = 0 list[1] = 1 list[2] = 2 

list[i] = i;  

or did miss something?


Comments