我有问题,我不知道如何编写方法标题。
示例:
public List<Object> getSubList(List<Object> l, int bot, int top){
return l.subList(bot, top);
}
我想要调用方法,但我不知道输入的字符串类型(字符串,整数或其他对象)。
我收到错误:
Imcopatible code: List<User> cannot be converted to List<Object>
答案 0 :(得分:0)
List<User> cannot be converted to List<Object>
,您无法将List<User>
传递给此方法。