Browse Source

Minor changes

main
Jesus 2 years ago
parent
commit
db5fe4c6f0
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/main/java/com/jesuspinar/miobjeto/serializable/Main.java

+ 4
- 2
src/main/java/com/jesuspinar/miobjeto/serializable/Main.java View File

@ -18,10 +18,12 @@ public class Main {
data.add(new Person("Jorge", 2)); data.add(new Person("Jorge", 2));
data.add(new Person("Pepe", 89)); data.add(new Person("Pepe", 89));
boolean isWrited = ObjWriter.write(data,file);
//Check writing
boolean isWritten = ObjWriter.write(data,file);
//Test serialization
People dat = null; People dat = null;
if (isWrited) {
if (isWritten) {
dat = (People) ObjReader.read(file); dat = (People) ObjReader.read(file);
} }
if (dat != null){ if (dat != null){


Loading…
Cancel
Save