Partial comparing

Partial comparing is achievable via the Path.startsWith() and Path.endsWith() methods. Using these methods, we can test whether the current path starts/ends with the given path:

boolean sw = path1.startsWith("/learning/packt");       // true
boolean ew = path1.endsWith("JavaModernChallenge.pdf"); // true
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.178.237