import java.util.Array List;
import java.util.Itera tor;
public class collectionsremo ve
{
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.hasNex t() )
{
it.next();
it.remove();
}
}
}
}
when i compile this code i get warning as :
collectionsremo ve.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
import java.util.Itera tor;
public class collectionsremo ve
{
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.hasNex t() )
{
it.next();
it.remove();
}
}
}
}
when i compile this code i get warning as :
collectionsremo ve.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
Comment