dimanche 4 juillet 2021

Is it possible to insert a new condition to a while loop mid-loop in java?

I have a while(notFound) loop. This loop first checks stuff that specified in option "a" however some point in the loop that option becomes "b" and in that case I need to somewhat update the loop to:

while((notFound) &&(trCollator.compare(data.getSurname("a"),current.data().getSurname("a")) == 0))

So are there any syntax that cheks the second part only if the option equals "b"?

Aucun commentaire:

Enregistrer un commentaire