How to invoke external process in java.



How to invoke external process in java...

Answer / Sarvesh Kumar Gautam

To invoke an external process in Java, you can use the ProcessBuilder class. Here's a simple example:nn```javanProcessBuilder pb = new ProcessBuilder("command", "arguments");nProcess process = pb.start();n``` Replace `command` with the command you want to execute and `arguments` with any required arguments for that command.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the output of the below java program?

1 Answers  


What is formatted output in java?

1 Answers  


What are the different types of sorting in java?

1 Answers  


what Data encapsulation in java?

5 Answers  


Can we have this () and super () together?

1 Answers  


What is the meaning of variable in research?

1 Answers  


What is a boolean expression in java?

1 Answers  


How does class forname work in java?

1 Answers  


Why do I need to declare the type of a variable in java?

1 Answers  


How we can execute any code even before main method?

1 Answers  


When should you use arraylist and when should you use linkedlist?

1 Answers  


Is a char always 1 byte?

1 Answers  


Categories