我无法从无限的通配符到特定的列表>
我在控制器类中尝试了此操作:
@Override
public void initialize(URL location, ResourceBundle resources) {
try {
games = (List<?>) fr.readFile();
@SuppressWarnings("unchecked")
List<GameImpl> games2 = (List<GameImpl>) games;
} catch (IOException e) {
System.out.println("err");
throw new RuntimeException(e);
}
但是当我尝试访问Games2功能时,发生了例外
I tried this in my controller class:
@Override
public void initialize(URL location, ResourceBundle resources) {
try {
games = (List<?>) fr.readFile();
@SuppressWarnings("unchecked")
List<GameImpl> games2 = (List<GameImpl>) games;
} catch (IOException e) {
System.out.println("err");
throw new RuntimeException(e);
}
but when I try to access games2 function, an Exception occurred
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论