0
Personally, i use while with a boolean test (iterators for example with the .hasNext() method) The for loop is more usefull when you need to work with indexes, to read an array for example
13th Dec 2016, 8:59 AM
Jikar
Jikar - avatar
0
A while loop is used to evaluate a condition that has an unknown number of iterations. A for loop sets up a counter to be used in a known number of iterations
14th Dec 2016, 2:02 AM
Cory Clapp
Cory Clapp - avatar