📄 fileopen.java
字号:
/*
* FileOpen.java
*
* Created on 2008年4月5日, 下午8:17
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package finaltest;
import java.io.*;
/**
*
* @author Administrator
*/
public class FileOpen {
static FileOpen flieopen;
/** Creates a new instance of FileOpen */
public FileOpen() throws FileNotFoundException, IOException {
String tempstr =null;
StudentNode.head =new StudentNode();
StudentNode temp =StudentNode.head;
StudentNode temp2 =null;
BufferedReader bufin =new BufferedReader(new FileReader("fei.txt"));
while(true){
if((tempstr = bufin.readLine())!=null){
String stu[] =tempstr.split("#");
temp.student =new Student();
temp.student.setId(stu[0]);
temp.student.setName(stu[1]);
temp.student.setAge(Integer.valueOf(stu[2]));
temp.student.setSex(stu[3]);
temp.student.setMajor(stu[4]);
temp.student.setMyclass(stu[5]);
StudentNode.rear =temp;
temp2 =new StudentNode();
temp.next =temp2;
temp2.prev =temp;
temp =temp.next;
}else{
temp.prev =null;
StudentNode.rear.next =null;
break;
}
}
bufin.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -