forum

Home / DeveloperSection / Forums / How to solve Java generics name clash , has the same erasure?

How to solve Java generics name clash , has the same erasure?

Anonymous User 4122 16-Oct-2014
I have superclass Foo. And a class Bar extending it.

public class Bar extends Foo

Function in Foo:

protected void saveAll(Collection<?> many)

Function in Bar:

public void saveAll(Collection<MyClass> stuff)
{
    super.saveAll(stuff);
}

Getting error :

Name clash: The method saveAll(Collection<MyClass>) of type Bar has the same erasure as saveAll(Collection<?>) of type Foo but does not override it.


java java  oops 
Updated on 16-Oct-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By