为什么显示错误:Undefine name 's'
import java.io.*;
public class Runtime1
{
/**
* The main entry point for the application.
*
* @param args Array of parameters passed to the application
* via the command line.
*/
public static void main (String[] args)
{
int i=0;
try{
String s[]=new String[2];
s[0]="/windows/exit.com";
s[1]="test.txt";
Runtime R=Runtime.getRuntime();
Process p=R.exec(s);
InputStream in=p.getInputStream();
OutputStream out=p.getOutputStream();
InputStream err=p.getErrorStream();
int exitcode=0;
try{
exitcode=p.waitFor();
}
catch (InterruptedException e){
}
System.out.println("Please print!!!!!!");
\\语句1:
System.out.println(s[0]+"exited withcode"+exitcode);
}catch(java.io.IOException e){}
System.out.println(s[0]+s[1]);
while(i++<10000);
}
}
为什么语句1没有输出?
为什么显示错误:Undefine name 's'?