Why is ArrayList not being written into "MyCalendar.txt"? Even when I use out.write() it still returns false but does not write to the file.

```
import java.util.*;
import java.io.*;

public static Boolean addAppointment(ArrayList<String> calendar, 
                     String specifiedDay,
                         String specifiedTime) {

PrintWriter out = new PrintWriter("myCalendar.txt"); //declare calendar file    

    for (int i = 0; i<calendar.size(); i++) {
        String index = calendar.get(i);
        if (index.equals(specifiedDay + "" + specifiedTime))
        { 
         out.println(specifiedDay + "" + specifiedTime);
         return false; 
        }
    }
    return true;
}

```