How do you pass input to an interactive program through an external file in java?

Answer:
hi

i used ProcessBuilder to run the program but i m stuck with how to pass input to the executable.


If i run that .exe file in cmd it asks to "enter your choice (1/2/3)"


How to pass the choice from my java code?
First answer by Anshu1012. Last edit by Anshu1012. Contributor trust: 0 [recommend contributor recommended]. Question popularity: 1 [recommend question].