import java.util.ArrayList;
import java.util.Iterator;
public class collectionsremove
{
public static void main(String[] args)
{
ArrayList arr = new ArrayList();
String str1 = "hi";
arr.add(str1);
arr.add("hello");
arr.add("wassup");
arr.add("wazzup");
arr.add("bye");
Iterator it = arr.iterator();
while(it.hasNext() )
{
it.next();
it.remove();
}
}
}
}
when i compile this code i get warning as :
collectionsremove.java use unchecked or unsafe operation
recompile with -Xlint : unchecked for detail
how to remove this warning .
anyhow my program runs fine , how to remove