Hello,
For my Java class I have to create an array. I won't know how many numbers will be input into the array. So far on the youtube videos I've seen, to create an array, they always seem to know how many numbers their want to store. So their examples are
Double nameOfArray[] = new Double[10];
so the array named nameOfArray will be an array using the Double type of number, and will have 10 values.
I have to create an array in which I don't know how many values, because the user will be inputting values from ( I assume ) the Scanner. For now to get around this, my array looks like
Double salesForWeek[] = new Double[900000];
Is there a better way to make this array? Also, I'm assuming I would need to use the Scanner since I need to prompt the user for the number. Is that a correct assumption?
Any help will be greatly appreciated.