This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help about generics

Tom Mark
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does the method below compiles?

and these two don't?

I know that when you call the method, you can declare V to be anything at all. And it's not ok.
But what about this method:

T can be B or C, but the argument of this method can be anything C, B, A and also Object because of "super" keyword (Letter<? super T> t) .
This is not within the bounds of the class declaration (public class Letter<E extends B>{}) .
Can you explain how the compiler works?
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic