What is the best way to exit/terminate a while loop in Java?
For example, my code is currently as follows:
while(true){ if(obj == null){
Finding a while...do construct with while(true) in my code would make my eyes bleed. Use a standard while loop instead:
while...do
while(true)
while
while (obj != null){ ... }
And take a look at the link Yacoby provided in his answer, and this one too. Seriously.
The while and do-while Statements