0

I have this method (using generics) :

public class ExtA<T>Ex<T> extends ArrayList
{    
    public<T> ExtA<T>Ex<T> filt(Function<T, Boolean> a...)
    {
  //code
    }
}

giving me an "incompatible types error".

user3126119
  • 323
  • 1
  • 3
  • 10

1 Answers1

5

Remove the leading <T> from your filt method declaration. It's shadowing the generic T type applied to the class.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152