13.2k views
3 votes
Which one of these choices best describes what exec() does:a) It replaces the current process with a new oneb) It executes a new process, which runs at the same time as the parentc) It terminates the process that calls it, because it calls exit() internally

1 Answer

2 votes

Answer:

Option b It executes a new process, which runs at the same time as the parent

Step-by-step explanation:

The exec is one of the Java Runtime methods which is used to create a new process and run it as an separate process. Exec method executes the string command that we place inside the bracket. For example,

Process proc = Runtime.getRuntime().exec("Notepad.exe");

The statement above offers a convenient way to open the another computer software such as Notepad when running the program.

User Taztingo
by
5.5k points