import java.io.*;
class Filedemo
{
public void openfile()
{
try{
FileInputStream fin = new FileInputStream("E:\\JAVA\\javawork\\dfdsa.txt");
System.out.println (fin.read());
fin.close();
}
catch(Exception e)
{
System.out.println (e.getMessage());
}
}
public static void main(String []args)
{
new Fidemo().openfile();
}
}刚学着用这个,一开始在javawork目录下有个tt.txt文件,fileinputstream创建时引用的也是这个文件 后来在程序中乱写了一个文件名 就像上面的 再运行的时候 程序还是正常的 而且读取的字符还是tt.txt的字符 我想知道这是为什么
class Filedemo
{
public void openfile()
{
try{
FileInputStream fin = new FileInputStream("E:\\JAVA\\javawork\\dfdsa.txt");
System.out.println (fin.read());
fin.close();
}
catch(Exception e)
{
System.out.println (e.getMessage());
}
}
public static void main(String []args)
{
new Fidemo().openfile();
}
}刚学着用这个,一开始在javawork目录下有个tt.txt文件,fileinputstream创建时引用的也是这个文件 后来在程序中乱写了一个文件名 就像上面的 再运行的时候 程序还是正常的 而且读取的字符还是tt.txt的字符 我想知道这是为什么
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货