附:
将想实现的两个功能放在一起,我已经会了。
import java.io.*;
public class Test
{
public static void main(String[] args) throws IOException{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("please intput line:");
System.out.println(bf.readLine());
}
}
[此贴子已经被作者于2007-10-7 16:06:48编辑过]
----------------解决方案--------------------------------------------------------
其实是一样的
import java.util.Scanner;
public class Test{
public static void main(String[] args){
Test t = new Test();
t.setSubject();
t.showSubject();
}
private String str;
public void setSubject(){
Scanner in = new Scanner(System.in);
str = in.next();
}
public void showSubject(){
System.out.println(str);
}
}
[此贴子已经被作者于2007-10-7 14:51:27编辑过]
----------------解决方案--------------------------------------------------------
谢谢哦~~
----------------解决方案--------------------------------------------------------