wood burning stoves 2.0*
The moose likes Java in General and the fly likes Overloading methods w/ generics causing erasure error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Overloading methods w/ generics causing erasure error" Watch "Overloading methods w/ generics causing erasure error" New topic
Author

Overloading methods w/ generics causing erasure error

Bobby Anderson
Ranch Hand

Joined: Oct 28, 2008
Posts: 114
Before generics I had this:



So I want to change to this:


But of course with erasure both these methods now have the same signature. Is there a good way around this or am I stuck with using arrays or changing one of the method names.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37936
    
  22
How about generic methods? Can you write public <T> void foo(List<T> lll) . . .?
 
 
subject: Overloading methods w/ generics causing erasure error
 
Similar Threads
Understanding Generics
Generics
Generics and Overriding
Compiling problem with generics.
Generics