这样的写法不能说有什么问题,但是一般不这么实现,首先第一,Stu类一般专门用来保存人的信息,所以建议定义一个专门的类。比如说:
public class Student implements Serializable {
    private String name;
    private int age;
    ...
    //下面写set和get方法
    ...
}
再转么写一个类来负责文件的读写,比如说:
public class FileUtil {
    public void save(String fname, Collection students) {
        //保存内容的时候不建议直接保存ArrayList的对象,因为这个对象是系统提供的,将来升级什么的都是不可控制的,所以我们宁愿将其中的Student对象一个个写入到文件中,将来一个个读出来就可以了
        Iterator it = students.iterator();
        while(it.hasNext()) {
            //write(it.next());
        }
    }
}
说得比较简单,单元表达出了我的想法。