How to cast List<Object> to List

后端 未结 16 921
时光取名叫无心
时光取名叫无心 2020-11-27 11:43

This does not compile, any suggestion appreciated.

 ...
  List list = getList();
  return (List) list;


Compil

16条回答
  •  粉色の甜心
    2020-11-27 12:01

    Your best bet is to create a new List, iterate through the List, add each item to the new list, and return that.

    提交回复
    热议问题