Using the import java.util.Collections;
like I should be. Not the GWT one. Have the class with the error in the shared folder for a GWT project.
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
shuffle() Method in Java with Examples. shuffle() method of Collections class as the class name suggests is present in utility package known as java. util that shuffles the elements in the list.
Shuffle Array Elements using Collections Class We can create a list from the array and then use the Collections class shuffle() method to shuffle its elements. Then convert the list to the original array. Output: [1, 7, 5, 2, 3, 6, 4] Note that the Arrays. asList() works with an array of objects only.
Quoted from 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.
Specifically, if you look at Collections
in the Package java.util, you will see that it does not contain the shuffle()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With