Java Process isAlive() Method

The isAlive() method is used to test whether the currently executing process is alive or not.

Syntax

Parameter

NA

Return

The isAlive() method returns two value : true or false

  1. The method returns true if the process executed by the process object is not terminated yet.
  2. The method returns false if the process executed by the process object is terminated yet.

Example 1

Output:

A process is created:
false
Manually closes the notepad.
Wait is completed.

Example 2

Output:

Notepad will open
false
Ms paint will open
False