Update Print2DArray.java
This commit is contained in:
parent
b62e4d4baf
commit
6b8040ffff
@ -21,13 +21,6 @@ public class Print2DArray{
|
|||||||
System.out.println(Arrays.deepToString(myArray));
|
System.out.println(Arrays.deepToString(myArray));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printArrayAsList(int[][] myArray) {
|
|
||||||
for (int[] row : myArray) {
|
|
||||||
List<Integer> rowList = Arrays.asList(Arrays.stream(row).boxed().toArray(Integer[]::new));
|
|
||||||
System.out.println(rowList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void printArrayString(int[][] myArray) {
|
public static void printArrayString(int[][] myArray) {
|
||||||
for (int[] row : myArray) {
|
for (int[] row : myArray) {
|
||||||
System.out.println(Arrays.toString(row));
|
System.out.println(Arrays.toString(row));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user