What will be the output. Consider a directory structure like this (NT or 95)
C:\JAVA\12345.msg --File
import java.io.*;
public class IO {
public static void main(
String [] args) {
File f1 = new File("\\12345.msg");
System.out.println(f1.getPath());
System.out.println(f1.getParent());
System.out.println(f1.iaAbsolute());
System.out.println(f1.getName());
System.out.println(f1.exists());
System.out.println(f1.isFile());
}
}
The given answer for this is
\12345.msg
\
true
12345.msg
false
false
Why it is giving the result false for f1.exists() and f1.isFile(). It has given that 12345.msg is file and is in c:\java\12345.msg--file
Can somebody please explain....?
Thanks