import java.io.*;public class Echo{
public static void main (String[] args) {
throws IOException{
BufferedReader in=
new BufferedReader(
new InputStreamReader(System.in));
String s;
while((s=in.readLine()).length()!=0)
System.out.println(s);
}
}
}//运行出错如下:
D:\My Documents\JCreator Pro\MyProjects\IOTester\Echo.java:6: 非法的表达式开始
throws IOException{
^
D:\My Documents\JCreator Pro\MyProjects\IOTester\Echo.java:16: 需要 ';'
}
^
2 错误
public static void main (String[] args) {
throws IOException{
BufferedReader in=
new BufferedReader(
new InputStreamReader(System.in));
String s;
while((s=in.readLine()).length()!=0)
System.out.println(s);
}
}
}//运行出错如下:
D:\My Documents\JCreator Pro\MyProjects\IOTester\Echo.java:6: 非法的表达式开始
throws IOException{
^
D:\My Documents\JCreator Pro\MyProjects\IOTester\Echo.java:16: 需要 ';'
}
^
2 错误
import java.io.*;class Echo { public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String s; while ((s = in.readLine()).length() != 0) {
System.out.println(s);
}
}
}主语编码格式和语法
public class Echo{
public static void main (String[] args) throws IOException{
BufferedReader in= new BufferedReader( new InputStreamReader(System.in)); String s; while((s=in.readLine()).length()!=0)
System.out.println(s);
}
}