Given:
String originalPath = "data\projects\a-project\..\..\another-project";
Path path = Paths.get(originalPath); System.out.print(path.normalize());
What is the result?
A. dataanother-project
B. dataprojectsa-projectanother-project
C. data\projects\a-project\..\..\another-project
D. dataprojectsa-project….another-project
checked. D)
C. Screenshot above is right
public static void main(String[] args) {
String originalPath = “data\\projects\\a-project\\..\\..\\another-project”;
Path path = Paths.get(originalPath);
System.out.print(path.normalize());
}
> data\another-project
A