package Xwxx; import java.util.ArrayList; import java.util.Iterator; import java.util.function.IntBinaryOperator; public class Fanx { public static void main(String[] args) { ArrayList<String> list=new ArrayList<String>(); list.add("a"); list.add("b"); //list.add(1); Iterator<String> it=list.iterator(); while(it.hasNext()){ String str=(String)it.next(); System.out.println(str.length()); } } }