diff --git a/src/main/java/com/github/hcsp/polymorphism/Main.java b/src/main/java/com/github/hcsp/polymorphism/Main.java index fe62227..bd2cd82 100644 --- a/src/main/java/com/github/hcsp/polymorphism/Main.java +++ b/src/main/java/com/github/hcsp/polymorphism/Main.java @@ -6,7 +6,7 @@ public class Main { // "I am Sub, the param is ParamSub" public static void main(String[] args) { Base object = new Sub(); - ParamBase param = new ParamSub(); + ParamSub param = new ParamSub(); object.print(param); } } diff --git a/src/main/java/com/github/hcsp/polymorphism/ParamSub.java b/src/main/java/com/github/hcsp/polymorphism/ParamSub.java index e9845be..6b6d149 100644 --- a/src/main/java/com/github/hcsp/polymorphism/ParamSub.java +++ b/src/main/java/com/github/hcsp/polymorphism/ParamSub.java @@ -1,3 +1,5 @@ package com.github.hcsp.polymorphism; -public class ParamSub extends ParamBase {} +public class ParamSub extends ParamBase { + +}