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){
while(obj != null){ // statements. }