O'Reilly logo
  • A B thinks this is interesting:

Path path1 = Paths.get("/bats/night","../").resolve(Paths.get( "./sleep.txt")).normalize(); Path path2 = new File("../sleep.txt").toPath().toRealPath(); System.out.print(Files.isSameFile(path1,path2)); System.out.print(" "+path1.equals(path2));

From

Cover of OCP Oracle® Certified Professional Java® SE 8 Programmer II

Note

code formatting is broken