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

generic erasure

 
taras khoma
Greenhorn
Posts: 9
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator





what the difference between those codes? I can't understand why the first one does not compile at all and with the second all fine ;(
 
Stephan van Hulst
Bartender
Pie
Posts: 4838
34
Chrome Netbeans IDE Windows
  • 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with erasure. It's just a simple rule. You can go from generic to non-generic, but not the other way around.

It's hard to explain using your example, because the generic type parameters are useless anyway. There's nothing you can do with T that will make the code more useful.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic