private Trip[] trips;
private int[] distanceTraveled = new int[] { 8, 6, 15, 5 };
for (int i = 0; i < distanceTraveled.length; i++) {
trips[i] = new Trip(0, i, distanceTraveled[i]);
}
for (Trip trip: trips) {
System.out.println(trip.toString());
}
I am trying to write the values in distanceTraveled array to fill the array of objects for Trip[], but this code returns. Any help will be appreciated
@20ce73ec
@393679df
@56627197