62,614
社区成员
发帖
与我相关
我的任务
分享
<root>
<classInfo>
<studentInfo>
<name>Tom</name>
<age>21</age>
</studentInfo>
<studentInfo>
<name>Tom</name>
<age>21</age>
</studentInfo>
<studentInfo>
<name>Tom</name>
<age>21</age>
</studentInfo>
</classInfo>
</root>
如不用xml,最简单的是使用txt文本文件
student_1304.txt,txt中一行代表一名学生信息
#序号,学号,班级,姓名,性别,联系电话
0001,1304001,1304,Tom,male,1373430000
0002,1304002,1304,Lucy,female,1374444
使用IO,读取这个txt。
无论哪种方式,读取的信息可以保存List或者Map中,这个List或者Map保存在内存中(就是建个static属性,把这个List或者Map赋值给它),就可以直接使用。
2)点名信息
建个文件夹roll-call,然后在这个文件夹中
roall-call-student-1304-20131014.properties
每天都生成roall-call-student-1304的一个文件。
文件里保存
学号=0
学号=1
或者学号=true
学号=false
自己使用Properties类写个工具类,从文件中读取