Question

while (iterator.hasNext()) 
{
    Object element = iterator.next();
    if (removalCheck(element)) 
    {
        iterator.remove();
    }
}

I have some collection framework related program which I am trying to comprehend. My problem is what is that removalCheck doing over there.Is it a method? If so what is its class hierarchy. Or is it an operator similar to instanceof or anything other than those mentioned.
I tried searching about that but couldn't get a conclusive answer.

Was it helpful?

Solution

Assuming that the code you posted is syntactically valid and compiles without errors, it's a helper method, either in the class you're viewing or in a class extended by the class you are viewing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top