Import java.io.bufferedreader; import java.io ioException; import java.io.inputstreamReader;
public class TestInOutErr {public static void main (String [] args) throws IOException {Process p = Runtime.getRuntime () exec ( "java AppTest");. BufferedReader in = new BufferedReader (new InputStreamReader (p.getInputStream ())) ; String currentLine = null; while (! (currentLine = in.readLine ()) = null) System.out.println (currentLine); BufferedReader err = new BufferedReader (new InputStreamReader (p.getErrorStream ())); while (( Currentline = Err.Readline ())! = null) System.out.println (Currentline);}}