My understanding: the method turns even indexed objects blank. The first element is at index 0 and is thus going to be made blank. That's why the boolean is set to true as opposed to false at the beginning.
As for your second question it will turn String element into "one" although "one" would be more appropriately named "zero."
The problem with the method that I see (not sure if I'mt just seeing things though) is that it will only delete the first even element (index 0).
Code:
public static void changeEvenToEmpty (List<String> strList)
{
boolean even = true;
ListIterator<String> itr=strList.listIterator();
while(itr.hasNext()) {
itr.next();
if(even) {
itr. set ("");
even=!even;
}
}
} As once even is set to false it is never set true again and no other element is set to blank. "The even=!even;" needs to be put outside the if structure.
Is that what the original question is asking?