The interaction between Path and Paths seems simple enough. You get a Path object using the Paths get() method. Then you can use the Path methods:
Path p = Paths.get("C:\\directory\\filename.txt"); p.getFilename(); p.getRoot(); p.getParent(); etc...
What scares me is that the Java documentation describes Path as an interface. Typically, an interface is just a collection of method signatures that you must implement in any class that claims to use it with the implements keyword.
However, in the case of Path, there is no keyword "implements", and you do not implement methods. They are already predetermined.
I obviously got the wrong end of the stick. Can someone explain what I misunderstood?
source share