當前位置:編程學習大全網 - 網絡軟體 - java.lang.NegativeArraySizeException,怎麽解決阿

java.lang.NegativeArraySizeException,怎麽解決阿

壹般用於表單提交時候,用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());//

}

}

  • 上一篇:馬德林的2013年 編劇《愛的婦產科》
  • 下一篇:瑞文光速qa教學。
  • copyright 2024編程學習大全網