0
List<Lists> listOfLists = db.getAllLists();

db.getAllLists() returns a List object.

Am I making use of Polymorphism without knowing here?

fiverivers
  • 5
  • 1
  • 6

1 Answers1

1

Yes, because you don't know (and really don't need to care about) which implementation of List interface is returned by db.getAllLists().

More info:

Community
  • 1
  • 1
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332