This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generic Method Declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Generic Method Declaration" Watch "Generic Method Declaration" New topic

Generic Method Declaration

Clay Chow
Ranch Hand

Joined: Nov 09, 2008
Posts: 35

Would it ever be possible to see a generic method declartion that looks like K<K>. I have tried and not been able to get one to compile. For example:

Also, I do not fully understand why this will not compile.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45302

That looks very peculiar. List<K> would look more likely.
Consider Paul's rocket mass heater.
subject: Generic Method Declaration
It's not a secret anymore!