?? 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 + -