In this chapters FlightTimes class, modify the displayFlightTimesTable method by converting the two for loops that iterate
Question:
In this chapter’s FlightTimes class, modify the displayFlightTimesTable method by converting the two for loops that iterate over the columns, so that they use for-each loops instead.
There’s no comparable benefit to converting the for loop that iterates over the rows. Why? Because if it’s converted to a for-each loop, then there’s no row index variable, and that variable is needed later on as an index into the cities array:
System.out.printf(CITY_FMT_STR, cities[row]);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean
Question Posted: