I am trying to make a java program that appends text into an existing document. This is what it has gotten me at:

```
import java.util.*;
import java.io.*;
public class Main
{
    public main(String args[])
    {
        System.out.print("Please enter a task: ");
        Scanner taskInput = new Scanner(System.in);
        String task = taskInput.next();
        System.out.print(task);

        PrintWriter writer = new PrintWriter("res\tasks.txt", "UTF-8");
        writer.println("The first line");
        writer.println("The second line");
        writer.close();
    }

}

```

I have some errors and do not know how to fix them. I looked at the Bufferedwriter but I don't know how it's used, and yes I have looked javadocs. C++ was not nearly this complicated. Once again, I want to know how to make the program append text to an existing file. It should be efficient enough to make into an app. Are there any good resources to teach how to write/append/read files?? javadoc is not doing it for me.