Question: I'm using a getter method to return an `ArrayList` to my main method. I then save these lists into text files. The problem I have is in the way the output is displayed 

Is there a way to save my array Lists in this way 

eg:

```
12           
45         
56            
34            
65

```

rather than 

```
[12, 45, 56, 34, 65]

```

I'm using a `PrintStream` and I'm outputting to a text file.

Regards

**edit**

```
for(Subject sub : st.getSub()){
         save.println(s.getSubject());
         save.println(s.getHomeworkMark());
         save.println(s.getExamMark());
        }

```

I have something liike that, but since im using a getter method, it doesnt let me loop through each record.... thos are retrieving from arrayLists, but when I output, it outputs as a whole rather than individuals

Answer: 
You can do it in one line if you want:

```
List<Integer> list; // assuming this

printStream.print(list.toString().replaceAll("^.|.$", "").replace(", ", "\n"));

```
Solved this by making a temporary variable....