Explanation
1. The Process class is an abstract class (all methods are abstract), encapsulating the process (i.e. executing the program).
2. The Process class provides methods for inputting from the process, executing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying the process.
Example
Process p = null; try { p = Runtime.getRuntime().exec("notepad.exe"); p.waitFor(); } catch (Exception e) { e.printStackTrace(); } System.out.println("我想被打印...");
Java is mainly used in: 1. web development; 2. Android development; 3. client Development; 4. Web development; 5. Enterprise-level application development; 6. Java big data development; 7. Game development, etc.
The above is the detailed content of How to use Process in java. For more information, please follow other related articles on the PHP Chinese website!