Skip to content

Commit ea64a50

Browse files
author
Anass Rach
committed
fix missing endraw!
1 parent 0f03f76 commit ea64a50

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

math.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ System.out.println(arr1 == arr2); // false (reference comparison)
145145
System.out.println(Arrays.equals(arr1, arr2)); // true (content comparison)
146146
System.out.println(Arrays.equals(arr1, arr3)); // false (different content)
147147

148+
// Multi-dimensional arrays
149+
int[][] matrix1 = {{1, 2}, {3, 4}};
150+
int[][] matrix2 = {{1, 2}, {3, 4}};
151+
152+
System.out.println(Arrays.equals(matrix1, matrix2)); // false (shallow comparison)
153+
System.out.println(Arrays.deepEquals(matrix1, matrix2)); // true (deep comparison)
154+
```
155+
148156
**Array to String conversion:**
149157
```java
150158
int[] array = {1, 2, 3, 4, 5};
@@ -155,6 +163,7 @@ int[][] twoDArray = {{1, 2}, {3, 4}};
155163
System.out.println(Arrays.toString(twoDArray)); // [references] (not useful)
156164
System.out.println(Arrays.deepToString(twoDArray)); // [[1, 2], [3, 4]]
157165
```
166+
{% endraw %}
158167

159168
**💡 Learning Tip:** Remember "ARRAYS = UTILITY BELT" - Arrays class has tools for every common array operation. Use deepEquals() and deepToString() for multi-dimensional arrays.
160169

0 commit comments

Comments
 (0)