Chthonic Project
Chthonic Project

Reputation: 8356

java.nio.file.Path vs sun.nio.fs.UnixPath

Almost all file I/O operations in my Java code uses java.nio.*. While debugging a piece of code today, however, I noticed that the debugger (Intellij IDEA 14) was showing the following piece of information for a java.nio.file.Path instance:

debugger-screenshot

Why is java.nio.file.Path object being shown as sun.nio.fs.UnixPath object in the debugger? What is the difference between these two classes?

Upvotes: 3

Views: 5622

Answers (1)

AlexR
AlexR

Reputation: 115338

java.nio.file.Path is an interface, sun.nio.fs.UnixPath is its concrete implementation in your environment. If for example you run your code on Windows you see sun.nio.fs.WindowsPath.

Upvotes: 9

Related Questions