Just a curious question, not important really. More for a discussion.
Isn't using
int i = 0;
boolean count = false;
pretty much the same thing when flagging? I mean when something goes right, change
i = 1;
count = true;
and get the same result. What's the advantage of boolean over a simple int change? example:
for (int i = 0; i < newArray.length; i++)
{
if (i == element)
{
count = true;
newArray[i] = combinedInfo[i + 1];
}
else
if (count)
newArray[i] = combinedInfo[i + 1];
else
newArray[i] = combinedInfo[i];
}
versus
for (int i = 0; i < newArray.length; i++)
{
if (i == element)
{
i = 1;
newArray[i] = combinedInfo[i + 1];
}
else
if (i == 1)
newArray[i] = combinedInfo[i + 1];
else
newArray[i] = combinedInfo[i];
}
thanks