public static void main(String args[]){
try {
FileInputStream fs=new FileInputStream(args[0]);
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} }
try {
FileInputStream fs=new FileInputStream(args[0]);
} catch (FileNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} }
是不是这一句执行完后,fs就释放了。
因为要是上面的写法,我的下面这句报错。
DataInputStream ds=new DataInputStream(fs);