File: getCanonicalPath() : File « java.io « Java by API
- Java by API
- java.io
- File
File: getCanonicalPath()
/*
* Output:
getCanonicalPath() = C:\winnt
*/
import java.io.File;
public class MainClass {
public static void main(String args[]) {
try {
File file = new File("c:\\winnt");
System.out.println("getCanonicalPath() = " + file.getCanonicalPath());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Related examples in the same category