From 4280b171962f2995f208c4200830857764639c2d Mon Sep 17 00:00:00 2001 From: Neetika23 <42495275+Neetika23@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:08:15 +0530 Subject: [PATCH] Delete core-java-modules/core-java-arrays-guides/src/main/java/com/baeldung/print2DArrays/Print2DArray.java --- .../baeldung/print2DArrays/Print2DArray.java | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 core-java-modules/core-java-arrays-guides/src/main/java/com/baeldung/print2DArrays/Print2DArray.java diff --git a/core-java-modules/core-java-arrays-guides/src/main/java/com/baeldung/print2DArrays/Print2DArray.java b/core-java-modules/core-java-arrays-guides/src/main/java/com/baeldung/print2DArrays/Print2DArray.java deleted file mode 100644 index cc54f25c06..0000000000 --- a/core-java-modules/core-java-arrays-guides/src/main/java/com/baeldung/print2DArrays/Print2DArray.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.baeldung.print2DArrays; - -import java.util.*; - -public class Print2DArray{ - - public static String print2DNested(int[][] myArray){ - StringBuilder result = new StringBuilder(); - for (int i = 0; i < myArray.length; i++) { - for (int j = 0; j < myArray[i].length; j++) { - result.append(myArray[i][j]).append(" "); - } - result.append("\n"); - } - return result.toString(); - } - - public static String print2DStream(int[][] myArray){ - StringBuilder result = new StringBuilder(); - Arrays.stream(myArray).flatMapToInt(Arrays::stream).forEach(num -> result.append(num).append(" ")); - return result.toString(); - } - - public static String print2DDeepToString(int[][] myArray){ - StringBuilder result = new StringBuilder(); - result.append(Arrays.deepToString(myArray)).append("\n"); - return result.toString(); - } - - public static String printArrayString(int[][] myArray) { - StringBuilder result = new StringBuilder(); - for (int[] row : myArray) { - result.append(Arrays.toString(row)).append("\n"); - } - return result.toString(); - } -}