private String stuName;
private short stuAge;
private double stuScore;
//get,set方法...略
//toString()將所有信息返回
}
Class test{
public static void main(String args[]) throws Exception{
//根據反射機制獲取Student類
Class.forName("Student.class");
//鍵盤輸入可以用System.in
//將輸入的值設置到Student 對象中
//由於是純文本可以用BufferdWriter類寫到壹個文件中
}
}