new InputStreamReader(System.in)); //收数
String inputLine = in.readLine(); //据
StringTokenizer str =
new StringTokenizer(inputLine," ");//接收的数据用空格隔开,这个类用来提取每个字符串
long num = Integer.valueOf(str.nextToken()).longValue();//学号
String name = (String)str.nextToken(); //姓名
String sex = (String)str.nextToken(); //性别
double mark = Integer.valueOf(str.nextToken()).doubleValue();//分数
all = String.valueOf(num) +" , "+
name +" , "+
sex +" , "+
String.valueOf(mark);//把所有的数据用" , "隔开然后在连起来放进字符串all
}catch (IOException e){}
catch (NumberFormatException e){}
return all;//返回字符串all
}
public void addData(String str)//增加数据的方法
throws IOException
{
String s1 ="",s2="" ,s3= "";
File file = new File("data.txt");