Skip to content

Commit

Permalink
Write second object to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Juergen Falb committed Dec 7, 2021
1 parent bbce59b commit 166d4e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/at/ac/fhcampuswien/subtyping/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static void main(String[] args) {
FileOutputStream fos = new FileOutputStream("objects.dat");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(subTypeC);
oos.writeObject(subTypeD);
oos.close();
} catch (IOException e) {
e.printStackTrace();
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/at/ac/fhcampuswien/subtyping/SubTypeD.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package at.ac.fhcampuswien.subtyping;

public class SubTypeD implements BaseTypeB {
import java.io.Serializable;

public class SubTypeD implements BaseTypeB, Serializable {
@Override
public void method1() {
System.out.println("Method implementation / Variante 1");
Expand Down

0 comments on commit 166d4e4

Please sign in to comment.