Java: When to use a While Loop?
How do I exit a while loop in Java? - Stack Overflow
Why don’t we see more use of the “do...while” loop?
do while is primarily used when you want to go through one iteration of the loop body. while do implies you might not execute the body at all. I wouldn't pick one over the other based on perceived efficiency. I would base it primarily on whether you know you'll do one iteration or not.
Do while loop
Videos
My Intro to programming class has covered how to use both for and while loops. As for the code I am good to go with it but I am having a little trouble understanding them.
When would I use a while loop? Why would that be the better choice for the loop over a for loop?
Though I know how to code them I do not quite have a full comprehension on determining which to use and why one would be better than the other.
Any examples and/or like laymen's break down would be much appreciated!