采用菜单形式,1)该系统主要处理字符串的相关信息。
2)完成以下的操作:初始化字符串、获得字符串长度、在字符串中查找一个字符、在字符串中查找另一个字符串、字符串连接、字符串比较等
注意使用时要放在一个文件夹内!!!!
import Java.io.*;
import java.util.*;
public class Student implements Comparable {
String name;
int stuID;
double sum;
String grade;
double course1, course2, course3;
TestStudent ts;
BufferedReader br = null;
DataOutputStream dos = null;
DataInputStream dis = null;
Student(TestStudent ts) {
this.ts = ts;
if (br == null)
br = new BufferedReader(new InputStreamReader(System.in));
if (dos == null)
try {
dos = new DataOutputStream(new FileOutputStream(
"f:/lv/b/Hello.txt"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
System.out.println("姓名: ");
try {
name = br.readLine();
dos.writeUTF("name:" + name);