怎样才能用这个sop方法来打印呢?
请老司机帮看看如何实现sop方法,下面的代码错误在哪里呢?import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
public class Jihejianliduixiang {
public static void main(String[] args) {
List list=new ArrayList();
list.add("WorldHello!");
list.add("Helloworld!");
Iterator first=list.iterator();
while(first.hasNext()) {
System.out.print(first.next()+" ");
}
sop("集合长度为:"+list.size());
public static void sop(Object obj) {
System.out.println(obj);
}
}
}