• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Generics - wildcard with multiple bounds

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !

Adrian
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


Thanks,
 
Adrian Sosialuk
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
explanation

Thanks,

Adrian
 
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
take a look here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5052951
 
Adrian Sosialuk
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !

Adrian
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic