for( i = 0;i<count1;i++){ while(mod){ stockName[i] = portFolioStockName(); stockSym[i] = portFolioStockSym(); unitPrice[i] = portFolioUnitPrice(); unitBought[i] = portFolioUnitBought(); portFolioSummary(i); System.out.print("If Ok, enter 0 else enter 1 to modify :"); myInt = myScanner.nextInt(); mod = (myInt !=0); totalStock = unitPrice[i]*unitBought[i]; cashLeft = capital - totalStock; } mod=true;
what can i do to remember the i = 0 initializer,because my for loop will be repeated for quite a number of times depending on the loopand my arrays are created depending on the i initializer how can i remember the i ? because my current code overwrites the arrays[i] each time, my for loop is used again as i value starts at 0 again.while(mod)