Consider the following program:
import java.nio.file.*; import java.util.Iterator; public class Main { public static void main(String[] args) { Path aFilePath = Paths.get("D:\\dir\\file.txt"); Iterator<Path> paths = aFilePath.iterator(); while(paths.hasNext()) { System.out.print(paths.next() + " "); }/*from w w w.jav a 2 s . co m*/ } }
Assume that the file D:\dir\file.txt does not exist in the underlying file system.
Which of the following options best describes the behavior of this program when it is executed?
e)
The name elements in a path object are identified based on the separators.
Note: To iterate name elements of the Path object does not actually require that the corresponding files/directories must exist, so it will not result in throwing any exceptions.