You can't assign a Vector<PallinoNome> to a Vector<PincoPallino>. The problem is that if you did, you'd then be able to add instances of other classes that implement PincoPallino into a collection that was originally supposed to be a Vector<PallinoNome>. So you'd lose the type safety that generics are supposed to give you.
The general rule is, even if A is-a B, a GenericClass<A> is-not-a GenericClass<B>.
Your options to get round this are:
- Use either PincoPallino or PallinoNome as your generic type everywhere
- Make your method generic, and use a bounded type parameter - Use a wildcard type parameter