3

i'm trying to understand the basics of polymorphism. I do understand why it could be useful to assign a superclass to a sub class or a sub to a super.

what i don't understand quite well is the logic of assigning or accessing a interface to the reference of a sub class, can someone explain why this can be usefull?

Andrew Tobilko
  • 48,120
  • 14
  • 91
  • 142
Kenan
  • 31
  • 2
  • 2
    I am not really sure what you mean by "..assign a interface reference to a subclass of superclass that implements the interface.." but I am guessing this may be related: [What does it mean to “program to an interface”?](https://stackoverflow.com/q/383947) – Pshemo Dec 29 '18 at 10:48

0 Answers0