使用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()方法.