import java.io.*;
public class TestFileInputStream {
public static void main(String []args) {
try {
FileInputStream stream =null;
stream = new FileInputStream("E:/javadocument/Stream/TestFileInputStream.java");
} catch (FileNotFoundException e) {
System.out.println("wenjianmingmeizhaodao");
System.exit(-1);
}
long num = 0;
int b;
try {
while((b = stream.read()) != -1) {
System.out.print((char)b);
num++;
}
stream.close();
System.out.println();
System.out.println(num);
} catch (IOException e) {
System.out.println("fashengcuowu");
System.exit(-1);
}
}
}
编译时总是显示变量stream找不到符号,为什么?