Java Generics and generic types

后端 未结 2 1338
半阙折子戏
半阙折子戏 2021-01-16 05:01

I have a class ExtA which contains a filter function to filter an ArrayList:

public ExtA filt(...)
{

 //code


}

when I compile i

2条回答
  •  甜味超标
    2021-01-16 05:33

    You have to put the parameter on the method:

    public  ExtA filt(Func a) {
    // method code
    }
    

提交回复
热议问题