-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabOneArray.java
More file actions
20 lines (13 loc) · 862 Bytes
/
LabOneArray.java
File metadata and controls
20 lines (13 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package unit07.mySolutions;
// Creates array "arr" and populates with integers 1-25
public class LabOneArray {
public static void main(String[] args) {
int [] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
// Prints array values in lots of 5 stacked on top of one another
System.out.println(arr[0] + ", " + arr[1] + ", " + arr[2] + ", " + arr[3] + ", " + arr[4]);
System.out.println(arr[5] + ", " + arr[6] + ", " + arr[7] + ", " + arr[8] + ", " + arr[9]);
System.out.println(arr[10] + ", " + arr[11] + ", " + arr[12] + ", " + arr[13] + ", " + arr[14]);
System.out.println(arr[15] + ", " + arr[16] + ", " + arr[17] + ", " + arr[18] + ", " + arr[19]);
System.out.println(arr[20] + ", " + arr[21] + ", " + arr[22] + ", " + arr[23] + ", " + arr[24]);
}
}