微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java – Collection.shuffle无效 – GWT

使用import java.util.Collections;就像我应该的那样.不是GWT的.让GWT项目的共享文件夹中包含错误的类.

代码具有以下结构:

List<String []> qaList;
qaList = new ArrayList<String[]>();

qaList.add("12345 main st","tomah");
qaList.add("124 main st","lacrosse");
qaList.add("123 main","yeeehahaaa");

Collections.shuffle(qaList);

给我这个错误

[ERROR] [_012cfaexam] – Line 109: The method shuffle(List<String[]>) is undefined for the >type Collections

解决方法

引自 GWT’s JRE Emulation Reference

Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list below shows the set of JRE packages,types and methods that GWT can translate automatically. Note that in some cases,only a subset of methods is supported for a given type.

具体来说,如果您查看Package java.util中的集合,您将看到它不包含shuffle()方法.

原文地址:https://www.jb51.cc/java/127470.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐