process_6.java

来自「gcc的组建」· Java 代码 · 共 32 行

JAVA
32
字号
// Create a running process for a non existent executable.// Verify that IOException is thrown.import java.io.IOException;public class Process_6{  public static void main(String[] args)  {    try      {	int c;	Runtime r = Runtime.getRuntime();	String[] a = { "blablabla_failure" };	try	  {	    Process p = r.exec(a);	    System.out.println("bad");	  }	catch (IOException ioe)	  {	    System.out.println("ok");	  }      }    catch (Exception ex)      {	System.out.println(ex.toString());      }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?