Skip to main content
2 of 2
Make generics in quote visible with code formatting.
rgettman
  • 178.7k
  • 30
  • 282
  • 365

When using generics, the inheritance concept is little bit different. You need to use wildcards and sub typing to achieve inheritance with generics.

As per oracle tutorial

Note: Given two concrete types A and B (for example, Number and Integer), MyClass<A> has no relationship to MyClass<B>, regardless of whether or not A and B are related. The common parent of MyClass<A> and MyClass<B> is Object.

kosa
  • 66.7k
  • 15
  • 134
  • 170