⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 studentinfowriter.java

📁 学生信息读系统(根据学生的学号从存储系统读取学生信息): 姓名
💻 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 + -