filename = "Questions\\Records"; File file=new File(filename); FileReader fr = new FileReader(file); BufferedReader br=new BufferedReader(fr); String line = br.readLine();
读取路径为filename的文件时,若文件的内容为
------------------------------------------------------------------------
0
------------------------------------------------------------------------
这个文件总共三行,第一行为
line == 0
第二行为
line.equals("")
第三行为
line == null标签:读取,equals,filename,new,line,null From: https://www.cnblogs.com/adrow/p/16748767.html