You assign values to slots in an array the same way if the values are int or objects:
theArray[theIndex] = theValue; // put theValue into theArray at index: theIndex
theArray and theValue must...
Type: Posts; User: Norm
You assign values to slots in an array the same way if the values are int or objects:
theArray[theIndex] = theValue; // put theValue into theArray at index: theIndex
theArray and theValue must...
If you must use an array, and do not know how many values you will put into it, do you know a maximum number that could possibly be used? Would 2000 be more than the user would input? Or 200 or 75?...
There are lots of examples on this forum that use loops and get values from arrays.
Also see:
Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)