Scott Selikoff wrote:See the paragraph after this example: "The first example actually throws an exception at runtime, as URIs must reference absolute paths at runtime" and see the feature on the previous page titled "Absolute vs a Relative is file system dependent".
In other words, it is file system dependent to some degree whether the runtime exception will be thrown.
Thanks for the reply Scott. In the example I posted above, I added a check :
System.out.println(path1.isAbsolute());
and this returned true, so this explained why this resulted in no runtime exception.
Then I tried this:
and this time I got a runtime exception. So it seems like the schema "file://" made the difference in making it an absolute path on my system, therefore I didn't need the 3 slashes as in path3 on page 458.