比如下面这个方法,都是要求传一个 File 两种方式有什么区别呢?包括像 getAbsoluteFile() 这种都是返回 File 对象,像 返回绝对路径名形式、路径名的规范形式 这些我感觉没区别。所以请教下各位。
public static String read(String fileName){
StringBuilder sb = new StringBuilder();
try{
BufferedReader in = new BufferedReader(
new FileReader(
new File(fileName).getAbsoluteFile()));
                //fileName));
try{
String s;
while((s = in.readLine()) != null){
sb.append(s);
sb.append("\n");
}
}finally{
in.close();
}
}catch(IOException e){
throw new RuntimeException(e);
}
return sb.toString();
}