This is my code. Trying to create a method call getVehicles that will convert the arrayList of vehicles to an array and then returns the array.
public class GSM{
private ArrayList <Vehicles> vehicleList = new ArrayList <Vehicles>;
private String garageName;
public GSM (String garageName)
{
this.garageName = garageName;
}
public void addVehicle(Vehicles A)
{
vehicleList.add(A)
}
public Vehicles[] v getVehicles()
{
}
I am new to ArrayList and Arrays, so I am having a bit of problem with this one.