Why does the following work fine?
String str; while (condition) { str = calculateStr(); ..... }
But this one is said to be dangerou
These two examples result in the same thing. However, the first provides you with using the str variable outside of the while loop; the second is not.
str