1,对象流的概念:

  1. 往文件中读或写对象;

    2,写对象的范例:

    1. Person person = new Person("aa", 13);
    2. ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("G\\xxx\\person.txt"));
    3. oos.writeObject(person);
    4. oos.close();

image.png
image.png