package Exer_11;
import java.util.*;
/**
* 练习2:修改SimpleCollection.java,使用Set来表示c。
* @author lzcysd
*
*/
public class Exer_11_2 {
public static void main(String[] args){
Set<Integer> c =new HashSet<Integer>();
for(int i = 0; i < 10; i++){
c.add(i);
}
for(Integer i : c)
System.out.print(i + ", ");
}
}/*运行结果
* 2, 4, 9, 8, 6, 1, 3, 7, 5, 0,
* ???
*/
-----------------------------------------------------------------------------------......
阅读全文