一瞬とまどうこの挙動
public class A { public static void main(String[] args) throws Exception { URL url = new URL("http://d.hatena.ne.jp/shot6/"); URL u2 = new URL(url, "/20070911"); System.out.println(u2.toString()); } }
url2で出力されるものに一瞬とまどったのでした。。。
あれ?そういうもんだったっけ?
public class A { public static void main(String[] args) throws Exception { URL url = new URL("http://d.hatena.ne.jp/shot6/"); URL u2 = new URL(url, "20070911"); System.out.println(u2.toString()); } }
ああ、こういうことね。。。
納得。絶対パスとしてみなされてしまうのか。