import java.lang.Process;
import java.io.*;
import java.io.InputStream;
import java.io.IOException;
public class prgms{
public static void main(String[] args) {
try {
// Execute a command without arguments
String command = "java JavaSimpleDateFormatExample";
Process child = Runtime.getRuntime().exec(command);
// Execute a command with an argument
// command = "java JavaStringBufferAppendExample";
//child = Runtime.getRuntime().exec(command);
} catch (IOException e) {
}
InputStream in = child.getInputStream();
int c;
while ((c = in.read()) != -1) {
process((char)c);
}
in.close();
}
}
I have modified this way... but the following error occurs,
prgms.java:17: cannot find symbol
symbol : variable child
location: class prgms
InputStream in = child.getInputStream();
^
prgms.java:20: cannot find symbol
symbol : method process(char)
location: class prgms
process((char)c);
^
2 errors