public class Test {
public static void main(String[] args) {
Student stu = new Student();
Student stu = new Student();
for(int i=0;i<2;i++){
Student stu2 = new Student();
}
}
}
我知道变量名是不能重复的,在for循环中stu2变量两次被用到是不是重复了?内存怎么分配的啊,请讲解一下原理哈for循环变量的生存中期是怎样的?