File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generics - wildcard with multiple bounds

 
Adrian Sosialuk
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
John Stone
Ranch Hand
Posts: 332
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic