• 2022-07-28
    Set类型的对象set可以以几种形式输出其内容?( )
    A: Iterator it = set.iterator();while (it.hasNext()) {System.out.println(it.next());}
    B: for (int i = 0; i < set.size(); i++) {System.out.println(set.get(i));}
    C: System.out.println(set.toString());
    D: for (Object obj : set) {System.out.println(obj);}