Users Pricing

forum

Home Forums How to solve Java generics name clash , has the same erasure? – MindStick

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

Anonymous User 4647 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md