You can add:
- references of type
B - references of any class which is a subclass of
B null
However, if you get a reference out of the list, its compile-time type will always be of type B — even if the runtime type is actually a subclass, or null.
1
solved What kind of values we can add to List type? [closed]