HI, aLL
final int[] fromStop = {1, 2, 3, 3, 4, 5};
final int[] toStop = {3, 4, 5, 1, 2, 3};
im trying to write a loop to create and start passenger threads
with the respective from and to stops in the arrays above.
e.g. Passenger 1 goes from stop 1 to stop 3 etc
class Passenger extends Thread
{
private int id; // unique id, from 1 to Main.PASSENGERS
private int from, to; // start and end bus stops
private Bus bus;
Passenger(int id, int from, int to, Bus bus)
{
this.id = id;
this.from = from;
this.to = to;
this.bus = bus;
}
Can anyone help???