import java.io.*; public class Collections { public static void main(String[] args) { try(ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/home/arthur/Рабочий стол/text.txt"))) { Person p = new Person("Sam", 33, 178, true); oos.writeObject(p); } catch(Exception ex){ System.out.println(ex.getMessage()); } } } class Person implements Serializable{ private String name; private int age; private double height; private boolean married; Person(String n, int a, double h, boolean m){ name=n; age=a; height=h; married=m; } String getName() {return name;} int getAge(){ return age;} double getHeight(){return height;} boolean getMarried(){return married;} } 

Here is the information recorded in the file enter image description here How to understand this format?

  • What do you want to understand here? How to disassemble it back? - Stranger in the Q
  • Why put text information with a picture? what would be more difficult for people? - KoVadim
  • 2
    The object is written as bytes with a specific structure. The structure can be viewed here: docs.oracle.com/javase/8/docs/platform/serialization/spec/… - aleshka-batman pm

0