I have a simple question.
How to read all the contents of the binary file in java ?
I wrote some code but it only retrieves the first object.
Here is my code:
ObjectInputStream in = new ObjectInputStream(new FileInputStream("C:\\Users\\فاطمة\\Downloads\\student.bin"));
Binary b2 = (Binary)in.readObject();
System.out.println("Student ID: " + b2.id);
System.out.println("Student Name: " + b2.name);
System.out.println("Student Grade: " + b2.grade);
in.close();