📄 studentinfowriter.java
字号:
//An abstract class for writing students' infomation.
//Subclasses should inherit this class and implement
//the abstrat method in order to write the students
//information into local files, database or others.
public abstract class StudentInfoWriter
{
//The student's ID.
protected String stuID=null;
//Append all information of a student into this StringBuffer.
//param infors must be the same structure describing
//in the readme.txt file.
public boolean writeInfos(String infors)
{
//Get student's ID.
boolean key=true;
int index=0;
while(key)
{
char c=infors.charAt(index);
if(c=='/')
{
key=false;
}
else
index++;
}
stuID=infors.substring(0,index);
boolean b=false;
try
{
write(infors);
b=true;
}
catch(Exception e)
{
b=false;
}
return b;
}
//Abstract method for writing char array into a local file,
//database or others.
public abstract void write(String ins) throws Exception;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -