This Java tip illustrates a method of sending an input to a command. Developer may use this tip to sent input from the code. This is very helpful in cases when developer wants send an input in a command prompt without the interruption of the user.

 try {
        // Execute command
        String command = "cat";
        Process child = Runtime.getRuntime().exec(command);
        // Get output stream to write from it
        OutputStream out = child.getOutputStream();
        out.write("some text".getBytes());
    } catch (IOException e) {