You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Example code in File Systems Basics tutorial needs a try block #266
In Learn > The Java I/O API > File System Basics > Manipulating Files and Directories, section "Checking Whether Two Paths Locate the Same File" the code below needs a try block as it throws IOException.
if (Files.isSameFile(p1, p2)) {
// Logic when the paths locate the same file
}
Possibly trivial, as it's small and incomplete code example, but it might still aid understanding to know that is required. I also expanded the code example to try some things out, which others may also do, so would save a bit of time to include upfront.
Activity
JosePaumard commentedon Jul 31, 2026
Thank you again for your report! I added a mention on this IOException, and a link to the Exception section.