Browse Source

(feat) implement optional section on polymorphism

main
Rob Hallam 7 months ago
parent
commit
4466f6271a
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      week23.java

+ 10
- 0
week23.java View File

@@ -286,3 +286,13 @@ class DemoSavingsAccount {

}
}

class PolymorphismTest {
public static void main(String[] args) {
Person telemachus = new Person();
telemachus.setName("Τηλέμαχος");
BankAccount b = new SavingsAccount(telemachus, 10);

System.out.println(String.format("%s", b));
}
}

Loading…
Cancel
Save