I\'m doing a project with basic Java for a CS class. The project has a for loop nested inside a while loop.
I am not allowed to use break as a wa
This question seems to enter the territory of a very old still unresolved argument, the "Single vs. Multiple method exit points".
So if using return in a loop is worrying you (or your teacher), you (or he) could have a look here.
To answer your question. In my (and not only my) opinion using a return in a loop is definitely OK.
Do note however that overusing it might decrease code readability (see linked answer for details/examples).