직접 돌려보시는 게 제일 이해하기 빠르 겁니다.
---- Test.java ----
import java.io.*;
public class Test {
public static void main(String[] args) throws Exception {
File file = new File("../../foo/bar.txt");
System.out.println("Canonical Path: " + file.getCanonicalPath());
System.out.println("Absolute Path: " + file.getAbsolutePath());
}
}
-------------------
결과는 다음과 같이 나오죠
d:\work\test\file> java Test
Canonical Path: d:\work\foo\bar.txt
Absolute Path: d:\work\test\file\..\..\foo\bar.txt
.小 魚 兒 .............................
><>. ><>. 그대 안의
><>. 작은 물고기
.......................작은............