Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Generics - wildcard with multiple bounds Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Generics - wildcard with multiple bounds" Watch "Generics - wildcard with multiple bounds" New topic

Generics - wildcard with multiple bounds

Adrian Sosialuk
Ranch Hand

Joined: Jun 07, 2007
Posts: 57
Hello everyone,

I'm new here and I would like to ask two questions:

1) Is there any special forum for java's generics questions ?

2) Why it is not allowed for a wildcard to have more then one bound, like:

Thanks a lot !

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1710
Hi Adrian,
Welcome to JavaRanch!

You can use type parameter instead of wild card. Multiple bounds are allowed
with type parameter. There are two kinds of bounds lower bounds and upper
bounds with wildcards, whereas there is no such thing as lower bound in the
type parameter.


Adrian Sosialuk
Ranch Hand

Joined: Jun 07, 2007
Posts: 57
Hi Chandra !

Thanks for quick reply.

Yes - I know that I can use type parameters instead.
I just wanted to know why Sun decided not to allow to
have multiple bounds on wildcards. There is a good explanation
about why there isn't a lower bound on type parameters
in Angelika Langers FAQ, so I was hoping to get a similar


John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
take a look here:
Adrian Sosialuk
Ranch Hand

Joined: Jun 07, 2007
Posts: 57
Oh yeah ...

That at least says there could be some usefulness of it
I assume, that it had to meet some bigger difficulties in
implementation process. I still wonder what they were ...

Thanks a lot anyway !

jQuery in Action, 3rd edition
subject: Generics - wildcard with multiple bounds
It's not a secret anymore!