79664015

Date: 2025-06-12 19:25:08
Score: 0.5
Natty:
Report link

The term you are looking for is a Canonical Path. In fact, it would be good to read up on the term Canonical, as that will provide useful context.

So, if you want to know if 2 instances of Path are pointing to the same object, then find the Canonical Path to the file.

The way to find the Canonical Path to a file in Java is to use the method Path.toRealPath().

System.out.println(a.toRealPath().equals(b.toRealPath())); //true, as it should be!
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: davidalayachew