This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes generic erasure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "generic erasure" Watch "generic erasure" New topic
Author

generic erasure

taras khoma
Greenhorn

Joined: Mar 14, 2011
Posts: 8





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

Joined: Sep 20, 2010
Posts: 3600
    
  14

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
 
subject: generic erasure
 
Similar Threads
Overriding generic methods
shadowing
What does it mean
Overriding and Overloading
Can Any One Explain Me The Following Codes Briefly