error:
D:\rage\Hello.java:13: cannot resolve symbol
symbol : method read (java.lang.String)
location: class java.io.InputStream
yourName = System.in.read("please input your name:");
^
1 error
D:\rage\Hello.java:13: cannot resolve symbol
symbol : method read (java.lang.String)
location: class java.io.InputStream
yourName = System.in.read("please input your name:");
^
1 error
public Test(){}
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s;
try{
while ((s = br.readLine()).length() != 0)
System.out.println(s);
}catch(IOException ioe){
ioe.printStackTrace();
}
}
}
你那行出错是不是要输出什么提示信息呢?
用System.out.println()吧!