Declare Variables Inside or Outside a Loop
Declare Variables Inside or Outside a Loop
The question of readability is more religious but does have a little to do with performance. The question about memory and performance goes hand in hand and can be shown definitively. I am going to go through both questions and show the difference from the byte code level using javap. I am not a byte code expert but I will do my best to explain the code properly. If there is an error in my explanation please let me know.
