Java.lang.Process Class

Java.lang.Process Class


The java.lang.Process class provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process.

Class declaration

Following is the declaration for java.lang.Process class:

public abstract class Process
   extends Object

Class constructors

S.N.Constructor & Description

This is the Single Constructor.

Class methods

S.N.Method & Description
1abstract void destroy()

This method kills the subprocess.

2abstract int exitValue()

This method returns the exit value for the subprocess.

3abstract InputStream getErrorStream()

This method gets the error stream of the subprocess.

4abstract InputStream getInputStream()

This method gets the input stream of the subprocess.

5abstract OutputStream getOutputStream()

This method gets the output stream of the subprocess.

6abstract int waitFor()

This method causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.

Methods inherited

This class inherits methods from the following classes:

  • java.lang.Object

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.