java.lang.RuntimeException错误 求帮助
1个回答
展开全部
一般用于表单提交时候,用post来提交,用get就会出现这个异常:
int[] arr = new int[10];
int i = arr[-1];
public class TestNull {
public static void main(String[] args) {
Student stu = new Student(1,"a","b");
Teacher tea = new Teacher();
tea.setId(1);
tea.setName("bbb");
tea.setStu(stu);
stu = null;//<span style="color: #FF0000;">这里可以优化内存么</span>
System.out.println(tea.getStu().toString());
System.out.println(tea.toString());//
}
}
int[] arr = new int[10];
int i = arr[-1];
public class TestNull {
public static void main(String[] args) {
Student stu = new Student(1,"a","b");
Teacher tea = new Teacher();
tea.setId(1);
tea.setName("bbb");
tea.setStu(stu);
stu = null;//<span style="color: #FF0000;">这里可以优化内存么</span>
System.out.println(tea.getStu().toString());
System.out.println(tea.toString());//
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询