About Question enthuware.ocpjp.v11.2.3335 :
Posted: Tue Apr 20, 2021 11:42 am
"Assuming that the file module-info.java and the folder out\foo.bar exists". I think you can read this as the file exists in path p1 (instead of p2) what makes the answer different.
Other thing. In the answer is mentioned that "it copies a file", but I guess this should be "it moves a file". In class Files is metioned:
public static Path move(Path source, Path target, CopyOption... options) throws IOException
Move or rename a file to a target file.
By default, this method attempts to move the file to the target file, failing if the target file exists except if the source and target are the same file, in which case this method has no effect.
Other thing. In the answer is mentioned that "it copies a file", but I guess this should be "it moves a file". In class Files is metioned:
public static Path move(Path source, Path target, CopyOption... options) throws IOException
Move or rename a file to a target file.
By default, this method attempts to move the file to the target file, failing if the target file exists except if the source and target are the same file, in which case this method has no effect.