I called a getElements
method which returns Iterable
.
I did this:
List elements = (List
List
is a type of Iterable
, but that doesn't mean that all Iterable
objects are List
objects. You can cast a List
as an Iterable
, but not the other way around.
An apple is a type of fruit, but that doesn't mean that all fruits are apples. You can cast an apple as a fruit, but not the other way around.