You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1024,6 +1024,86 @@ Note : The Code Content will be available on this [link](https://github.com/ackw
1024
1024
1025
1025
Note : The Code is available on this [link](https://github.com/ackwolver335/Java-Coder/blob/main/arr_mds.java)
1026
1026
1027
+
## Multidimensional Arrays
1028
+
1029
+
Multidimensional Arrays can be defined in simple words as array of arrays. Data in multidimensional arrays are stored in tabular form (in row major order).
1030
+
1031
+
Syntax Code :
1032
+
1033
+
```java
1034
+
importjava.util.Arrays;
1035
+
int[][] twoD_arr =newint[2][3]; // 2 Rows and 3 Columns
1036
+
int[][][] threeD_arr =newint[2][2][2] // 2 Rows and 2 Columns and 2 z-directional flow
1037
+
1038
+
// Accessing Elements
1039
+
System.out.println("Array's First Row " + Arrays.toString(arr[0]));
1040
+
```
1041
+
1042
+
Note : At the Basic level of concept the code [link](https://github.com/ackwolver335/Java-Coder/blob/main/arr_multi.java) is here.
1043
+
1044
+
## Categories of Arrays
1045
+
1046
+
-**Jagged Arrays** : A jagged array is an array of arrays such that member arrays can be of different sizes, i.e., we can create a 2-D array but with a variable number of columns in each row. These types of arrays are also known as Jagged arrays.
1047
+
1048
+
Syntax Code :
1049
+
1050
+
```java
1051
+
int arr[][] =newint[3][]; // initializing array first
1052
+
arr[0] =newint[2]; // Number of elements in first row
1053
+
arr[1] =newint[3]; // Number of elements in second row
1054
+
arr[2] =newint[2]; // Number of elements in third row
1055
+
```
1056
+
1057
+
Code Link : [Click_me](https://github.com/ackwolver335/Java-Coder/blob/main/arr_jagg.java)
1058
+
1059
+
-**Final Arrays** : The array arr is declared as final, but the elements of an array are changed without any problem. Arrays are objects and object variables are always references in Java. So, when we declare an object variable as final, it means that the variable cannot be changed to refer to anything else.
1060
+
1061
+
Syntax Code :
1062
+
1063
+
```java
1064
+
finalint arr[] =newint[3];
1065
+
```
1066
+
1067
+
Code Link : [Click_me](https://github.com/ackwolver335/Java-Coder/blob/main/arr_final.java)
1068
+
1069
+
-**Reflect Arrays** : The Array class in java.lang.reflect package is a part of the Java Reflection. This class provides static methods to create and access Java arrays dynamically. It is a final class, which means it can’t be instantiated or changed. Only the methods of this class can be used by the class name itself.
0 commit comments