Forums Register Login

Generics in Java

+Pie Number of slices to send: Send
Hi All,

List<Number> and List<? extends Number>?

List<Number> --> List of Numbers (or instances of Number) : Will it only take Number as argument ?

List<? extends Number> --> List any type which extends Number  : Will it only take subclass of Number class ?

+Pie Number of slices to send: Send
Somebody else asked a similar question a few weeks ago: here.

I don't think this is the best place for this question: let't move you to the same forum as the older thread.
See where your hand is? Not there. It's next to this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 235 times.
Similar Threads
Generic Question: wildcard with super
Clarification need in Generic Methods
Kb question pg 634
Generics doubt!!..Please help!!
Superclass has subclass reference
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:49:43.