This is the code. I tried to solve it, but I can\'t understand how its output is 111111?
public class Test { public static void main(String[] args) {
take a look at my answer here : Why am I not getting the output I am supposed to be?
anyway... the answer is simple... in first loop, print your array and you will see what happens to your array something like this:
for (int i = 1; i < list.length; i++){ list[i] = list[i - 1]; System.out(list); }