English, asked by subhoknr5, 4 months ago

Java calling program ​

Answers

Answered by priyammbafnagmailcom
0

Answer:

// A sample Java program (Written for Windows OS)

// to demonstrate creation of external process

// using Runtime and Process

class CoolStuff

{

public static void main(String[] args)

{

try

{

// Command to create an external process

String command = "C:\Program Files (x86)"+

"\Google\Chrome\Application\chrome.exe";

// Running the above command

Runtime run = Runtime.getRuntime();

Process proc = run.exec(command);

}

catch (IOException e)

{

e.printStackTrace();

}

}

Another way to create an external process is using ProcessBuilder which has been discussed in below post.ProcessBuilder in Java to create a basic online Judge

Similar questions
Math, 2 months ago