Home > Java > javaTutorial > How to use Process in java

How to use Process in java

王林
Release: 2023-05-10 11:04:05
forward
1314 people have browsed it

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("我想被打印...");
Copy after login

What Java can be used for

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template