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) {
As someone posted, your for-loop causes this result (11111). You also mentioned your question be like "It's storing values in to an array?". To my best understanding on your question, it's like you are trying to get the values from an array and store them into an another array. If so, this could be one of the options.
public static void main(String []args){
int[] list = {1, 2, 3, 4, 5, 6};
int[] myList = new int[list.length];
for (int i=0; i