解决方案 »
- tomcat6.x的数据源配置问题?
- hibernate OutOfMemoryError
- 懂JSP就能找到工作了吗?
- struts中的system.out
- soap远程调用后,输出信息怎么返回?
- SCJP考题!请详细说说原因!
- 再拿出100分javaMail问题
- 急!!!偶然会冒出java.sql.SQLException: Io 异常: Connection reset by peer:socket write error
- 着急!!谁能告诉我哪里有Weblogic6.1 + Crack可以下载???? 在线等待!
- 在windowsxp 下安装j2ee的问题
- 学完ssh,和ssi以后,想学点其他的东西了,大神们有什么推荐的吗
- JFreeChart 乱码问题
main方法中的x是指向的是 = 号后面的 new ArrayList<Student>();
传进readTxtFile 方法的是x的拷贝,x的拷贝指向的是外面的 new ArrayList<Student>();
你在readTxtFile 方法内 x = new ArrayList<Student>(); 将x 的拷贝指向了新的内存地址
这时候,readTxtFile 里面的x跟main方法里面的x 已经分别指向不同的内存地址了
你操作readTxtFile 里面的x 对main方法里面的x 不会产生任何影响了
将readTxtFile 方法内的 x = new ArrayList<Student>(); 去掉就可以了