This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| File f = new File("foo.txt"); | |
| // You're not allowed to make a Path using raw strings, | |
| // that would be dangerous! | |
| Path p = FileSystems.getDefault().getPath("foo.txt"); | |
| // Both of these type check :) | |
| f.getName().endsWith(".txt"); // true | |
| p.getFileName().endsWith(".txt"); // false |
OlderNewer