About Question enthuware.ocpjp.v7.2.1602 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Chen@ukr.net
Posts: 9
Joined: Sat Feb 27, 2016 1:17 pm
Contact:

About Question enthuware.ocpjp.v7.2.1602 :

Post by Chen@ukr.net »

an empty path is returned if this path does have a root component and all name elements are redundant
but i try:

Code: Select all

Path p = Paths.get("C:\\\\..");
        System.out.println(p.normalize());
        //C:\
i can`t repeat condition:
an empty path is returned if this path does have a root component and all name elements are redundant
my assumption that must be
an empty path is returned if this path does not have a root component and all name elements are redundant

kakawi
Posts: 5
Joined: Sat Aug 12, 2017 1:43 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1602 :

Post by kakawi »

By the way, I tried this code on Linux (Ubuntu) and found that

Code: Select all

normalize()

doesn't work for Windows path
On my machine it work only for paths like /home/foo/bar/../..

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1602 :

Post by admin »

The statement in the explanation is correct as per Javadoc https://docs.oracle.com/javase/8/docs/a ... ormalize--
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests