MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

files/PartsOfPaths.java:8–23  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6
7public class PartsOfPaths {
8 public static void main(String[] args) {
9 System.out.println(System.getProperty("os.name"));
10 Path p =
11 Paths.get("PartsOfPaths.java").toAbsolutePath();
12 for(int i = 0; i < p.getNameCount(); i++)
13 System.out.println(p.getName(i));
14 System.out.println("ends with '.java': " +
15 p.endsWith(".java"));
16 for(Path pp : p) {
17 System.out.print(pp + ": ");
18 System.out.print(p.startsWith(pp) + " : ");
19 System.out.println(p.endsWith(pp));
20 }
21 System.out.println("Starts with " + p.getRoot() +
22 " " + p.startsWith(p.getRoot()));
23 }
24}
25/* Output:
26Windows 8.1

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected