Method signature that takes any parameter as input

How can I declare a method signature that takes Long, Integer as input?

I tried following but it gives a compilation error:

List<Myobject> fun ( ? extends Number) value){
 //impl       

}

Answer

public <N extends Number>List<T>  xx(N a) {...}

Leave a Reply

Your email address will not be published. Required fields are marked *