I am using this code, and for some reason, I'm getting a No Such Element Exception...
numCompanies is being imported from the keyboard and is showing up right and portfolio is an array with [numCompanies][4].
Can anyone figure out why?
for(int i = 0; i < numCompanies; i++)
{
System.out.print("Stock #" + (i+1) + ": ");
String stockData = kbReader.nextLine();
System.out.print("\n\n hi" + stockData);
Scanner stockLine = new Scanner(stockData);
for(int j = 0; j < 4; j++)
{
portfolio[i][j] = stockLine.next();
}
}