I’m writing this tutorial with help from Java Second solutions by John Lewis and William Loftus, most of it is from me but a few of the definitions are from the book.

What an array does: An array is a way of indexing an holding a large sum of information that can be called, used and sorted.

Declaring and Initializing an array: for an array to work you need to initialize it to a certain constant for example int[] height = new int[11]; . This will create a 1 dimensional array that holds 11 spots for integers. Integer arrays can only hold numbers, string arrays can hold numbers and letters and words but you can’t do addition with the string arrays.

Visualization:
1D array: A 1 dimensional array is an array that’s just one column and this is usually used for sorting simple information like sorting.

2D array: A 2 dimensional array is like an excel table you have x amount of columns and x amount of rows that can be pulled by going down the rows and the columns and putting information in those slots. for example int[] 2dheight = new int[5][11]; this will hold 55 spots that can be dedicated to integers. With the 5 rows and 11 columns. This is the most common array especially for passwords.

3D array: A 3 dimensional array can be thought of as a cube. With the first digit being a specific part like if you made a 3 d string array that holds world info like if you made an array string[] country = new string[10][5][11]; would allow you to go thru any part of the first like the 10 would be countries and then from there you could go to 5 regional provinces and like 11 cities.

ND array: Any array with N dimensions should be thought of a bunch of lesser arrays, like visualize a 4 d array just as a bunch of limited 3 dimensional arrays, if it helps visualize the arrays in space like a bunch of interconnected 3d arrays (or cubes if you will) connected by some common thread.

Sorting made easy: Sort an array by descending or assending order with integers you should use a comparision statement like(don’t mind the syntax errors or the lack of variable declarations)while (x < arraycounter){ arraycounter = 0; int x = 0; if {(array[1][x] > array[1][x + 1]); temp = array [1][x];array[1][x] = array[1][x + 1]; array[1][x + 1] = temp;} x++;}

searching an array: use a comparison statement with this too. Cout << “enter search variable”; Cin >> variable while (h > arraycounter2){ while (x < arraycounter) { if (array [1][x] == variable){ cout >> array[1][x];}
x++;}h++}