用 -Xlint 编译我的代码我发现了这个:
warning: [unchecked] unchecked cast
found : java.lang.Object
required: java.util.ArrayList<java.lang.String>
ArrayList<String> msgData = (ArrayList<String>)element;
这是代码:
ArrayList<ArrayList<String>> msg = new ArrayList<ArrayList<String>>();
//add some data to msg
Iterator i = msg.iterator();
while(i.hasNext()) {
Object element = i.next();
ArrayList<String> msgData = (ArrayList<String>)element;
}
演员应该怎么做?