How to create an instance variable called passengers which is an array of references to person objects. the length of the array represents the number of passengers that the vehicle can hold i.e. the capacity of the vehicle which is given as a parameter to the constructor.
This is what i have done so far
public class Vehicle{
private String LicensePlateNum, make, model;
private int year, NumOfDoors, NumOfWheels;
private Person driver;
private Person [] passengers;
private int NumOfPassengers;
private int capacity;
public Vehicle(String LicensePlateNum, String make, String model, int year, int NumOfDoors, int NumOfWheels, int capacity){
this.LicensePlateNum=LicensePlateNum;
this.make=make;
this.model=model;
this.year=year;
this.NumOfDoors=NumOfDoors;
this.NumOfWheels=NumOfWheels;
this.capacity=capacity;
NumOfPassengers=0;
driver=null;
passengers=new Person[capacity];
}