importjava.util.*;publicclassA3{publicstaticvoidmain(String[]args){ArrayLista=newArrayList();a.add(52);a.add(25);a.add(19);a.add(38);a.add(48);a.add(54);a.add(46);a.add(2...
import java.util.*;
public class A3 {
public static void main(String[] args) {
ArrayList a = new ArrayList();
a.add(52);
a.add(25);
a.add(19);
a.add(38);
a.add(48);
a.add(54);
a.add(46);
a.add(28);
System.out.println(a);
Collections.sort(a);
System.out.println(a);
Collections.reverse(a);
System.out.println(a);
Collections.shuffle(a);
System.out.println(a);
Collections.rotate(a,2);
System.out.println(a);
ArrayList v = new ArrayList();
v.add(21);
v.add(56);
Collections.copy(a,v);
System.out.println(a);
System.out.println("列表中出现元素56的次数是:" + Collections.ferquency(a,19));
System.out.println("列表中最大的值是:"+ Collections.max(a));
System.out.println("列表中最小的值是:"+ Collections.min(a));
}
}
请教前辈们
System.out.println("列表中出现元素56的次数是:" + Collections.ferquency(a,19));
这里哪里出错了?提示找不到符号!
展开