title: How to open notepad.exe and Pass some data into it from Java?
body: <p>I opened notepad.exe using Java ProcessBuilder but I cannot pass text into it using the OutputStream. Following is my code:</p>
  
  <pre><code>public class Notepad {
  public static void main(String[] args) throws IOException, InterruptedException {
  
      ProcessBuilder pb=new ProcessBuilder("notepad.exe");
      Process process=pb.start();
  
      OutputStream d=process.getOutputStream();
  
      Scanner sc=new Scanner(System.in);
  
      while(sc.hasNext()){
              d.write(sc.nextInt());
      }
  }
  </code></pre>
  
  <p>}</p>