ois = new ObjectInputStream(new FileInputStream("users.dat"));
int n=0;
list[n] = (ArrayList) ois.readObject();
n++;
System.out.println(list.size());
因为你的数组没给定下标,所以只能输出一个对象,因为你后面插入的对象会把前面插入的对象覆盖。
肯定你没把对象写到ArrayList数组里啦。
我晕,流的读写操作都加了while(){}循环了吧,你这没加这循环,当然只读一次了
试试按行读取。
序列化类吗?