You would need to use an Iterator like so:
Iterator<String> iterator = a.iterator();
while(iterator.hasNext())
{
String value = iterator.next();
if ("abcd".equals(value))
{
iterator.remove();
break;
}
}
That being said, you can use the remove(int index) or remove(Object obj) which are provided by the ArrayList class. Note however, that calling these methods while you are iterating over the loop, will cause a ConcurrentModificationException, so this will not work:
for(String str : a)
{
if (str.equals("acbd")
{
a.remove("abcd");
break;
}
}
But this will (since you are not iterating over the contents of the loop):
a.remove("acbd");
If you have more complex objects you would need to override the equals method.