I'm making this array where the first number in the array should be 15 and the third as well. Then I need to print the array on the screen but I get an error when I do this, I've read that I got to write a loop when printing an array. How's that possible?
This is my current code.
int[] i = {15,0,15,0,0};
System.out.println(i);
And what's the difference in using this method or using
int [] i = new int [5];
Thanks in advance,
Michael.