how would you recommend doing tests on the NIO questions and gaining experience to do the final exam?
For me this examples:
Code: Select all
Path p1 = Paths.get("c:\\finance\\data\\reports\\daily\\pnl.txt");
System.out.println(p1.subpath(0, 2));
Code: Select all
Exception in thread "main" java.lang.IllegalArgumentException
at sun.nio.fs.UnixPath.subpath(UnixPath.java:348)
at sun.nio.fs.UnixPath.subpath(UnixPath.java:43)
at com.company.Main.main(Main.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
All examples seems to assume a so called 'C' drive but I don't think I have any way to test it.