buffer = my_in.readLine();
这里要扑捉ioException
try{
do{
System.out.print("Enter a command:");
System.out.flush();
buffer = my_in.readLine();
}while(!buffer.equals("exit"));
}catch(Exception e){}类名要和你的文件名一样,区别大小写。
另外好要设定:
环境变量path,和classpath
path=jdk安装目录\bin
classpath=.;jdk安装目录\lib
这里要扑捉ioException
try{
do{
System.out.print("Enter a command:");
System.out.flush();
buffer = my_in.readLine();
}while(!buffer.equals("exit"));
}catch(Exception e){}类名要和你的文件名一样,区别大小写。
另外好要设定:
环境变量path,和classpath
path=jdk安装目录\bin
classpath=.;jdk安装目录\lib
}
catch(IOException e){}加入异常处理吧!