About Path normalize() in Java -


for following code, apath turns out d:\ ocpjp7\ nio2\ src\subpath.java. why programs element gone?

path apath = paths.get(" d:\\ ocpjp7\\ programs\\..\\ nio2\\ src\\.\\ subpath.java");  apath = apath.normalize(); 

because normalization replaced .. programs' parent directory.

so have nio2 sub-folder of ocpjp7.

similarly, . goes away it's redundant (indicates current directory within context).


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -