public static void displaySummary(int totalShipment,
String[] nameOfBus,
int[][] storageBox)
{
int counter;
//Display the Summary Report
System.out.println("\nSummary\n- - - - - - - - - - - -");
for(counter = 0; counter < totalShipment; ++counter)
{
System.out.println("Shipment #" + (counter + 1)+ " - " + nameOfBus[counter]);
System.out.print("\nXL - " + storageBox[0][counter] + ",");
System.out.print("L - " + storageBox[1][counter] + ",");
System.out.print("M - " + storageBox[2][counter] + ",");
System.out.print("S - " + storageBox[3][counter]+"\n");
}
System.out.println("\nTotal Number of containers required for these shipments:\n");
System.out.println("XL - " + totalXL);
System.out.println("L - " + totalL);
System.out.println("M - " + totalM);
System.out.println("S - " + totalS);
}
When I call the displaySummary from main, regardless of any number of shipments, only the values of the last turn of the loop gets printed... If only one shipment, the values will be printed. If two shipments, the values of the second turn of the loop get printed but the first doesn't....