I have trouble with write txt file from class FileWrite in my java project , if the PRINT() method were in VehicleCollection class , and called in main class - don't have problems. But I want print method be in different class which named FileWrite and called in main method from this class . Here peace of Code . I hope that i write correct question. if i should Explain more about my code I will . 

I have 3 Classes 1st class is :

```
public class VehicleCollection  {

    private  ArrayList<VehicleInterface> arrList = new ArrayList<>();

    public ArrayList<VehicleInterface> getArrList() {
        return arrList;
    }

    void  setArrList(ArrayList<VehicleInterface> w){
        arrList = w;
    }

    public void getCollection() throws FileNotFoundException, IOException {
        Here Add in ArrayLIst...
    }
}

```

Second class is : 

```
public class FileWrite extends VehicleCollection {

    FileWrite(ArrayList<VehicleInterface> w){
        setArrList(w);
    }

    public void print() throws FileNotFoundException {

        Writer writer = null;
        try {
            String text = getArrList().toString();
            File file = new File("krasiWrite.txt");
            writer = new BufferedWriter(new java.io.FileWriter(file));
            writer.write(text);
            ...
        }

```

Third class is main class : 

```
FileWrite fw =  new FileWrite();
fw.print();

```

here Have error:cannot be applied to given types required ArrayList