Allocation of space for local variables in loops
问题 (true or false) The space for a local variable that is declared in the body of the loop is allocated whenever the loop body is executed and deallocated when the body finishes. The answer to this question is false. But why? 回答1: The statement is false because local variable space is not allocated and deallocated. It exists on the stack and is reserved when the method is entered. To see how stack space is used, write a small test program with: public static void test() { { int a = 1; long b = 2