Can any body explain this generic vector Vector<? super Object> list = ... and where to use it?
Here you are defining the lower bound of your unknown object ?. So the Vector<? super Object can contain only Object and any super class of Object. But since Object does'nt have a super class it has no sense. It behaves same as Vector<Object>.
Refer this sample.
The counterpart for this is upper bound Vector<? extends Object> where you can add any object that extends Object.
You should be able to avoid using Object as the generic type is most cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With