forked from davidjava1991/java17CompleteCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample1.java
More file actions
14 lines (13 loc) · 702 Bytes
/
Copy pathExample1.java
File metadata and controls
14 lines (13 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.david.class155;
public class Example1 {
public static void main(String[] args) {
ProcessHandle currentProcess = ProcessHandle.current();
System.out.println("Process Id: "+currentProcess.pid());
System.out.println("Direct children: "+ currentProcess.children());
System.out.println("Class name: "+currentProcess.getClass());
System.out.println("All processes: "+ProcessHandle.allProcesses());
System.out.println("Process info: "+currentProcess.info());
System.out.println("Is process alive: "+currentProcess.isAlive());
System.out.println("Process's parent "+currentProcess.parent());
}
}