Java 在使用Conllections中的bianarySeach ()方法时报错 no instance(s) of type vaiable(s) T text so that Student conforms to Comparable 异常处理

时间:2019-07-26 21:37:17   收藏:0   阅读:2633

异常类型:checked 异常,无法通过编译,具体情况如下所示

异常原因:如IDEA所提示,变量list没有合适的类型

处理方式:去掉ArrayList后面的泛型

技术图片

 

技术图片

 

 |--处理后

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!