qq_40545642
qq_40545642
2017-10-10 06:28

一下代码怎么提示找不到符号

  • arraylist

import java.util.*;

public class lianxi9
{
public static void main(String[] args)
{
Collection c1 = new ArrayList();
Collection c2 = new HashSet();
Random random = new Random();
for(int i =0;i<15;i++)
{
c1.add(random.nextInt(20));
c2.add(random.nextInt(20));
}
for(int i=0;i<5;i++)
{

System.out.println(c1.get(i));//此处报错
System.out.println(c2.get(i));//此处报错
}

}

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答