Can someone tell me how to make arrays and advanced arrays?
Also how to make arrays of objects, comparison of array values, and the arrays class in general?
Have a test tomorrow and am really confused about this. Please help.
Thanks Have a good day!
Hello I'm new too and I'd like to share a brief look at the structure of a single dimensional array and a multidimensional array or arrays and advanced arrays as you called them.
A single dimensional array follows a format like this:
dataType variableName = new dataType[arraySize]
double numbers = new double;
where the word "double" is the data type and the word "numbers" is the variable name. There is only one set of square brackets, , because this array is only one dimensional and the word "new" can be thought of as an extra requirement to declare the array.
If you want to read more on single dimensional arrays I'd recommend chapter 7, section 2, in the Java Programming 10th Edition book.
A multi dimensional array follows a format like this:
dataType variableName = [AmountOfRows][AmountOfColumns]
int multiNumbers = new int;
where the word "int" is the data type and the word "multinumbers" is the variable name, same as before. However, there are two sets of square brackets this time, , because this array is two dimensional and has rows and columns instead of just one row of variables.
If you want to read more on multi dimensional array I'd recommend you start at chapter 8, section 2, in the Java Programming 10th Edition book, same book as before